From a574499cac1fa8947e0f4f2f4db665895e326cef Mon Sep 17 00:00:00 2001 From: Osinachi Chukwujama Date: Fri, 9 Aug 2024 16:52:58 +0100 Subject: [PATCH] chore: update workflows --- .github/workflows/dev-deploy.yml | 33 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 65ef386..be38d64 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -9,7 +9,7 @@ on: jobs: build_and_upload_image: runs-on: ubuntu-latest - if: github.event_name == 'push' && github.event.repository.fork == false + if: github.event.repository.fork == false environment: development env: SSH_USERNAME: ${{ secrets.SSH_USERNAME }} @@ -40,26 +40,6 @@ jobs: SSH_USERNAME: ${{ secrets.SSH_USERNAME }} SSH_HOST: ${{ secrets.SSH_HOST }} SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} - steps: - - name: Deploy on server - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ env.HOST }} - username: ${{ env.USERNAME }} - password: ${{ env.PASSWORD }} - script: | - bash ./scripts/deploy_app.sh development https://github.com/${{ github.repository}} \ - - run_docker_container: - runs-on: ubuntu-latest - needs: [build_and_upload_image, update_repo_and_create_env] - if: github.event.repository.fork == false - environment: development - env: - SSH_USERNAME: ${{ secrets.SSH_USERNAME }} - SSH_HOST: ${{ secrets.SSH_HOST }} - SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} - steps: - name: Create app.env file uses: ./.github/actions/create-env-action @@ -92,6 +72,17 @@ jobs: source: app.env target: "~/deployments/development" + run_docker_container: + runs-on: ubuntu-latest + needs: [build_and_upload_image, update_repo_and_create_env] + if: github.event.repository.fork == false + environment: development + env: + SSH_USERNAME: ${{ secrets.SSH_USERNAME }} + SSH_HOST: ${{ secrets.SSH_HOST }} + SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} + + steps: - name: Update app with latest changes uses: appleboy/ssh-action@v1.0.3 with: