integration work #4
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
name: Integration | |
on: | |
push: | |
branches: | |
- main # or your default branch | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout code | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Step 2: Set up the environment | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.x' # specify your Node.js version | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: npm i | |
# step 4 Build | |
- name: Run build | |
run: npm build | |
# deploy: | |
# runs-on: ubuntu-latest | |
# needs: build # ensures the deploy job runs after the build job | |
# steps: | |
# # Step 1: Checkout code | |
# - name: Checkout code | |
# uses: actions/checkout@v2 | |
# # Step 2: Set up Node.js (again for deployment environment) | |
# - name: Set up Node.js | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: '14' | |
# # Step 3: Install dependencies (again in the deployment environment) | |
# - name: Install dependencies | |
# run: npm install | |
# # Step 4: Deploy to the server via SSH | |
# - name: Deploy to Server | |
# run: | | |
# ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} << 'EOF' | |
# cd /path/to/your/project | |
# git pull origin main | |
# npm install | |
# npm run build # if you have a build step, otherwise skip | |
# pm2 restart all # or your preferred process manager | |
# EOF | |
# env: | |
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} |