2021-08-19 09:56:39 +00:00
|
|
|
name: production-deployment-automation
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Deploy to Server
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ${{ secrets.REMOTE_HOST }}
|
|
|
|
username: ${{ secrets.REMOTE_USER }}
|
|
|
|
key: ${{ secrets.SERVER_SSH_KEY }}
|
|
|
|
port: 22
|
|
|
|
script: |
|
|
|
|
cd ${{ secrets.REMOTE_TARGET }} && \
|
|
|
|
git reset --hard && git clean -df && \
|
|
|
|
git pull && \
|
2021-09-08 17:29:37 +00:00
|
|
|
yarn install && \
|
|
|
|
yarn build --if-present && \
|
|
|
|
yarn generate --if-present && \
|
2021-08-19 09:56:39 +00:00
|
|
|
pm2 restart assembly --update-env
|