From 80fa4b000ac8f28c2b377b264a510858d3211310 Mon Sep 17 00:00:00 2001 From: Coopes Date: Tue, 28 Jan 2025 06:33:06 -0600 Subject: [PATCH] Update build-prod.yaml --- .github/workflows/build-prod.yaml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-prod.yaml b/.github/workflows/build-prod.yaml index 619ce20a3a..b1bfeba3e1 100644 --- a/.github/workflows/build-prod.yaml +++ b/.github/workflows/build-prod.yaml @@ -6,7 +6,6 @@ on: # Triggers the workflow on push or pull request events but only for the "prod" branch push: branches: [ prod ] - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -15,22 +14,26 @@ jobs: deploy: # The type of runner that the job will run on runs-on: ubuntu-latest + + # Add production environment protection + environment: production + # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v4 - + # Set up SSH authentication using our private key - name: Install SSH Key uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.PROD_SSH_KEY }} - + # Add our server to known_hosts to prevent SSH security prompts - name: Add Known Hosts - run: ssh-keyscan -H 206.81.100.181 >> ~/.ssh/known_hosts - + run: ssh-keyscan -H ${{ secrets.PROD_SERVER_IP }} >> ~/.ssh/known_hosts + # Connect to our server and run the update script - - name: Run Production Update Script + - name: Deploy run: | - ssh root@206.81.100.181 '/root/bin/update_prod.sh' + ssh ${{ secrets.PROD_SERVER_USER }}@${{ secrets.PROD_SERVER_IP }} '${{ secrets.PROD_DEPLOY_COMMAND }}'