-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build and Deploy Twitter App | ||
|
||
# Trigger the workflow on push or pull request to the main branch | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
# Define the jobs that will run | ||
jobs: | ||
build: | ||
|
||
# Use the latest Ubuntu runner | ||
runs-on: ubuntu-latest | ||
|
||
# Define the steps in the build job | ||
steps: | ||
# Step 1: Check out the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Set up Node.js (use the required Node version) | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' # You can specify your Node.js version | ||
|
||
# Step 3: Install dependencies for both backend and frontend | ||
- name: Install dependencies | ||
run: | | ||
npm install | ||
npm install --prefix frontend | ||
# Step 4: Build the frontend (assuming your frontend build script is set) | ||
- name: Build frontend | ||
run: npm run build --prefix frontend | ||
|
||
# Step 5: Run backend server (development) | ||
- name: Start backend server | ||
run: npm run dev | ||
|
||
# Optional: Add a step to run tests (if you have test scripts) | ||
# - name: Run tests | ||
# run: npm test |