Merge pull request #1 from junajan/deployment #10
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: Main CI | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Copy files to prod server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USER }} | |
key: ${{ secrets.SSH_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
source: "." | |
target: ${{ secrets.PATH }} | |
- name: Restart | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USER }} | |
key: ${{ secrets.SSH_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
envs: NODE_ENV,CALENDAR_ID,EARNINGS_HEADSUP_DAYS,GCP_CLIENT_EMAIL,GCP_PRIVATE_KEY | |
script: | | |
source ~/.profile | |
cd ${{ secrets.PATH }} | |
rm -rf .git | |
pnpm i | |
pnpm run prod:stop | |
NODE_ENV=${{ secrets.NODE_ENV }} CALENDAR_ID=${{ secrets.CALENDAR_ID }} EARNINGS_HEADSUP_DAYS=${{ secrets.EARNINGS_HEADSUP_DAYS }} GCP_CLIENT_EMAIL=${{ secrets.GCP_CLIENT_EMAIL }} GCP_PRIVATE_KEY="${{ secrets.GCP_PRIVATE_KEY }}" pnpm run prod:start |