From 1afc1cb5bd95dc1e1d35e4e50ea092a25813ed4a Mon Sep 17 00:00:00 2001 From: pvhil <54856838+pvhil@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:06:53 +0100 Subject: [PATCH] ignore local changes on deployment --- .github/workflows/cd.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 69111f0..c3f7640 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,11 +2,11 @@ name: Node.js CD -# Controls when the action will run. +# Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch push: - branches: [ master ] + branches: [master] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -17,17 +17,18 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Deploy using ssh - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.PRIVATE_KEY }} - port: ${{ secrets.PORT }} - script: | - cd FaceItDiscord - git pull origin master - git status - npm install - node deploy-commands-global.js - pm2 restart nodeFaceITBot + - name: Deploy using ssh + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.PRIVATE_KEY }} + port: ${{ secrets.PORT }} + script: | + cd FaceItDiscord + git reset --hard + git pull origin master + git status + npm install + node deploy-commands-global.js + pm2 restart nodeFaceITBot