From faa5c161f7e10fb173c474d40f0849eac6cacb92 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Tue, 19 Oct 2021 19:01:24 -0400 Subject: [PATCH] . --- .github/workflows/dev_deploy.yaml | 25 +++++++++++++++++++ .../{deploy.yaml => prod_deploy.yaml} | 8 +++--- 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/dev_deploy.yaml rename .github/workflows/{deploy.yaml => prod_deploy.yaml} (78%) diff --git a/.github/workflows/dev_deploy.yaml b/.github/workflows/dev_deploy.yaml new file mode 100644 index 0000000..2eec3a5 --- /dev/null +++ b/.github/workflows/dev_deploy.yaml @@ -0,0 +1,25 @@ +name: NodBot Dev Deploy + +on: + push: # tells github to run this on any push to the dev branch + branches: + - dev + +jobs: + deploy: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/dev' # we tell Github to only execute this step if we're on our dev branch + steps: + - name: Deploying to Probey + uses: appleboy/ssh-action@master # An action made to control Linux servers + with: # We set all our secrets here for the action, these won't be shown in the action logs + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script: | + cd nodbot-dev # we move into our app's folder + git pull # we pull any changes from git + npm prune # we remove any unused dependencies + npm install # we install any missing dependencies + pm2 reload nodbot-dev # we reload the app via PM2 diff --git a/.github/workflows/deploy.yaml b/.github/workflows/prod_deploy.yaml similarity index 78% rename from .github/workflows/deploy.yaml rename to .github/workflows/prod_deploy.yaml index 4c9ce5c..5f05f3e 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/prod_deploy.yaml @@ -1,16 +1,16 @@ -name: Node.js CI/CD +name: NodBot Production Deploy on: - push: # tells github to run this on any push to the repository + push: # tells github to run this on any push to the dev branch branches: - main jobs: deploy: runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' # we tell Github to only execute this step if we're on our main branch (so we don't put unfinished branches in production) + if: github.ref == 'refs/heads/main' # we tell Github to only execute this step if we're on our main branch steps: - - name: Deploying to Ayrenn + - name: Deploying to Probey uses: appleboy/ssh-action@master # An action made to control Linux servers with: # We set all our secrets here for the action, these won't be shown in the action logs host: ${{ secrets.HOST }}