Skip to content

Commit

Permalink
ci: Add Github Actions yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
IsthisLee committed Aug 6, 2023
1 parent b5b5f2f commit e04b881
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Main Branch CI/CD Workflow

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
name: Testing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn # caching npm dependencies

- name: Install dependencies
run: yarn install

- name: Testing with Jest
run: yarn test

pull_deploy:
name: Pull and Deploy
needs: test
runs-on: ubuntu-latest
steps:
- name: Executing remote ssh commands using password
uses: appleboy/[email protected]
with:
host: ${{ secrets.NCP_SERVER_IP }}
username: ${{ secrets.NCP_SERVER_USER }}
password: ${{ secrets.NCP_SERVER_PW }}
port: ${{ secrets.NCP_SERVER_PORT }}
script: |
~/deploy.sh
# TODO: change runs-on to self-hosted runner (or change NCP to AWS)

0 comments on commit e04b881

Please sign in to comment.