From c0ad6861680660e30befefd5b40d9b7a61728f21 Mon Sep 17 00:00:00 2001 From: Ishan Jain Date: Thu, 19 Aug 2021 15:26:39 +0530 Subject: [PATCH] Added production deployment automation --- ...embly-production-deployment-automation.yml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/assembly-production-deployment-automation.yml diff --git a/.github/workflows/assembly-production-deployment-automation.yml b/.github/workflows/assembly-production-deployment-automation.yml new file mode 100644 index 0000000..40ae43d --- /dev/null +++ b/.github/workflows/assembly-production-deployment-automation.yml @@ -0,0 +1,26 @@ +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 && \ + npm i && \ + npm run build --if-present && \ + pm2 restart assembly --update-env