fix: typecheck and version bug #13
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: Conditional Deploy to Server | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Try Git Pull on Server | |
id: git-pull | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /www/wwwroot/MMGC/MMGC-frontend | |
git pull || echo "Git pull failed, proceeding with SCP" | |
- name: Clear Remote Directory if Git Pull Fails | |
if: steps.git-pull.outcome == 'failure' | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
rm -rf /www/wwwroot/MMGC/MMGC-frontend/* | |
- name: Copy Repository to Server if Git Pull Fails | |
if: steps.git-pull.outcome == 'failure' | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
source: '.' | |
target: '/www/wwwroot/MMGC/MMGC-frontend' | |
- name: Install and Build on Server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /www/wwwroot/MMGC/MMGC-frontend | |
npm install | |
pm2 delete MMGCApp && npm run start:build |