From a507cde8b75f1e9bec21b500dcb494e2005b2efd Mon Sep 17 00:00:00 2001 From: Christopher Lindsay Date: Thu, 14 Dec 2023 23:14:21 -0500 Subject: [PATCH] chore: moved apply to seperate job --- .github/workflows/dev_pr.yml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/dev_pr.yml b/.github/workflows/dev_pr.yml index 00e8210805..2d03b750b0 100644 --- a/.github/workflows/dev_pr.yml +++ b/.github/workflows/dev_pr.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - + - name: Setup Bun uses: oven-sh/setup-bun@v1 with: @@ -27,7 +27,7 @@ jobs: - name: Install dependencies working-directory: ${{ env.WORKING_DIR }} run: bun install - + - name: Build Frontend working-directory: ${{ env.WORKING_DIR }} run: bun run build @@ -37,24 +37,14 @@ jobs: with: name: ${{ env.WORKING_DIR }}-${{ env.ENVIRONMENT }}-build-${{ github.sha }} path: ${{ env.WORKING_DIR }}/build - - deploy: + + plan-deploy: needs: build permissions: pull-requests: write runs-on: ubuntu-latest steps: - # - name: Debug Info - # run: | - # echo "Event Name: ${{ github.event_name }}" - # echo "Event Action: ${{ github.event.action }}" - # echo "Pull Request Number: ${{ github.event.pull_request.number }}" - # echo "Pull Request State: ${{ github.event.pull_request.state }}" - # echo "Pull Request Merged: ${{ github.event.pull_request.merged }}" - # echo "GitHub Event: ${{ toJson(github.event) }}" - # if: always() - - uses: actions/checkout@v3 - name: Download Frontend Artifacts @@ -66,8 +56,6 @@ jobs: - name: Get PR ID id: pr-id shell: bash - env: - GITHUB_REF: ${{ inputs.github_ref }} run: | PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT @@ -89,8 +77,12 @@ jobs: "commit_hash": "${{ github.sha }}" } + apply-deploy: + needs: plan-deploy + if: ${{ github.event.pull_request.closed }} && ${{ github.event.pull_request.merged }} + runs-on: ubuntu-latest + steps: - name: Terraform Apply - if: ${{ github.event.pull_request.closed }} && ${{ github.event.pull_request.merged }} uses: ./.github/actions/tf-apply with: terraform_directory: "terraform/eus/${{ env.ENVIRONMENT }}/frontend_asa"