From 0d964db7f32a963e403b02d4e41314b56674ce6a Mon Sep 17 00:00:00 2001 From: jrhoads Date: Thu, 19 Feb 2026 13:32:05 +0100 Subject: [PATCH 1/4] refactor: remove redundant vars job and update action versions --- .github/workflows/_build.yml | 10 +--- .github/workflows/_deploy.yml | 12 +--- .github/workflows/branch_to_staging.yml | 73 +++--------------------- .github/workflows/deploy.yml | 73 +++--------------------- .github/workflows/pull_request.yml | 60 +------------------- .github/workflows/release.yml | 74 +++---------------------- .github/workflows/test_branch.yml | 61 ++------------------ 7 files changed, 39 insertions(+), 324 deletions(-) diff --git a/.github/workflows/_build.yml b/.github/workflows/_build.yml index 2995a0a..8a09577 100755 --- a/.github/workflows/_build.yml +++ b/.github/workflows/_build.yml @@ -8,12 +8,6 @@ on: ENV_FILE: required: true type: string - REPOSITORY: - required: true - type: string - BRANCH: - required: true - type: string GIT_SHA: required: true type: string @@ -24,7 +18,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set Up Ruby uses: ruby/setup-ruby@v1 @@ -32,7 +26,7 @@ jobs: ruby-version: '2.7' - name: Install Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '14' diff --git a/.github/workflows/_deploy.yml b/.github/workflows/_deploy.yml index ff43377..51cc76d 100755 --- a/.github/workflows/_deploy.yml +++ b/.github/workflows/_deploy.yml @@ -8,12 +8,6 @@ on: ENV_FILE: required: true type: string - REPOSITORY: - required: true - type: string - BRANCH: - required: true - type: string GIT_SHA: required: true type: string @@ -38,15 +32,15 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '14' - name: Get cached build - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: build key: assets-build-${{ inputs.GIT_SHA }}-${{ inputs.RACK_ENV }} diff --git a/.github/workflows/branch_to_staging.yml b/.github/workflows/branch_to_staging.yml index 0d1f1a7..ca387d7 100755 --- a/.github/workflows/branch_to_staging.yml +++ b/.github/workflows/branch_to_staging.yml @@ -1,81 +1,26 @@ name: Build/Deploy Branch to Staging on: workflow_dispatch: - + env: RACK_ENV: stage ENV_FILE: .env.stage jobs: - vars: - runs-on: ubuntu-latest - outputs: - RACK_ENV: ${{ steps.extract_variables.outputs.RACK_ENV }} - ENV_FILE: ${{ steps.extract_variables.outputs.ENV_FILE }} - REPOSITORY: ${{ steps.extract_variables.outputs.REPOSITORY }} - BRANCH: ${{ steps.extract_variables.outputs.BRANCH }} - TAG: ${{ steps.extract_variables.outputs.TAG }} - GIT_SHA: ${{ steps.extract_variables.outputs.GIT_SHA }} - GIT_SHA_SHORT: ${{ steps.extract_variables.outputs.GIT_SHA_SHORT }} - LATEST_RELEASE: ${{ steps.extract_variables.outputs.LATEST_RELEASE }} - SITE_URL: ${{ steps.extract_variables.outputs.SITE_URL }} - SITE_NAME: ${{ steps.extract_variables.outputs.SITE_NAME }} - steps: - - name: Git checkout - uses: actions/checkout@v3 - - name: Get latest release tag - uses: oprypin/find-latest-tag@v1 - with: - repository: ${{ github.repository }} - releases-only: true - id: octokit - - name: GET .env - run: | - cp ${{ env.ENV_FILE }} .env - - name: Dotenv action - uses: falti/dotenv-action@v1.0.4 - id: dotenv - - name: Extract variables - shell: bash - run: | - echo "RACK_ENV=${{ env.RACK_ENV }}" >> $GITHUB_OUTPUT - echo "ENV_FILE=${{ env.ENV_FILE }}" >> $GITHUB_OUTPUT - echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_OUTPUT - echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "TAG=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "GIT_SHA=${{ github.sha }}" >> $GITHUB_OUTPUT - echo "GIT_SHA_SHORT=$( git rev-parse --short ${{ github.sha }} )" >> $GITHUB_OUTPUT - echo "LATEST_RELEASE=${{ steps.octokit.outputs.tag }}" >> $GITHUB_OUTPUT - echo "SITE_NAME=${{ steps.dotenv.outputs.SITE_NAME }}" >> $GITHUB_OUTPUT - echo "SITE_URL=${{ steps.dotenv.outputs.SITE_URL }}" >> $GITHUB_OUTPUT - id: extract_variables - - name: Print state - run: | - echo "RACK_ENV = ${{ steps.extract_variables.outputs.RACK_ENV }}" - echo "ENV_FILE = ${{ steps.extract_variables.outputs.ENV_FILE }}" - echo "REPOSITORY = ${{ steps.extract_variables.outputs.REPOSITORY }}" - echo "BRANCH = ${{ steps.extract_variables.outputs.BRANCH }}" - echo "GIT_SHA = ${{ steps.extract_variables.outputs.GIT_SHA }}" - build: - needs: [vars] uses: ./.github/workflows/_build.yml with: - RACK_ENV: ${{ needs.vars.outputs.RACK_ENV }} - ENV_FILE: ${{ needs.vars.outputs.ENV_FILE }} - REPOSITORY: ${{ needs.vars.outputs.REPOSITORY }} - BRANCH: ${{ needs.vars.outputs.BRANCH }} - GIT_SHA: ${{ needs.vars.outputs.GIT_SHA }} - + RACK_ENV: ${{ env.RACK_ENV }} + ENV_FILE: ${{ env.ENV_FILE }} + GIT_SHA: ${{ github.sha }} + deploy: - needs: [vars, build] + needs: [build] uses: ./.github/workflows/_deploy.yml with: - RACK_ENV: ${{ needs.vars.outputs.RACK_ENV }} - ENV_FILE: ${{ needs.vars.outputs.ENV_FILE }} - REPOSITORY: ${{ needs.vars.outputs.REPOSITORY }} - BRANCH: ${{ needs.vars.outputs.BRANCH }} - GIT_SHA: ${{ needs.vars.outputs.GIT_SHA }} + RACK_ENV: ${{ env.RACK_ENV }} + ENV_FILE: ${{ env.ENV_FILE }} + GIT_SHA: ${{ github.sha }} secrets: S3_BUCKET: ${{ secrets.STAGE_S3_BUCKET }} S3_REGION: ${{ secrets.STAGE_S3_BUCKET_REGION }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 25563bb..03e6c6d 100755 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,81 +3,26 @@ on: push: branches: - "master" - + env: RACK_ENV: stage ENV_FILE: .env.stage jobs: - vars: - runs-on: ubuntu-latest - outputs: - RACK_ENV: ${{ steps.extract_variables.outputs.RACK_ENV }} - ENV_FILE: ${{ steps.extract_variables.outputs.ENV_FILE }} - REPOSITORY: ${{ steps.extract_variables.outputs.REPOSITORY }} - BRANCH: ${{ steps.extract_variables.outputs.BRANCH }} - TAG: ${{ steps.extract_variables.outputs.TAG }} - GIT_SHA: ${{ steps.extract_variables.outputs.GIT_SHA }} - GIT_SHA_SHORT: ${{ steps.extract_variables.outputs.GIT_SHA_SHORT }} - LATEST_RELEASE: ${{ steps.extract_variables.outputs.LATEST_RELEASE }} - SITE_URL: ${{ steps.extract_variables.outputs.SITE_URL }} - SITE_NAME: ${{ steps.extract_variables.outputs.SITE_NAME }} - steps: - - name: Git checkout - uses: actions/checkout@v3 - - name: Get latest release tag - uses: oprypin/find-latest-tag@v1 - with: - repository: ${{ github.repository }} - releases-only: true - id: octokit - - name: GET .env - run: | - cp ${{ env.ENV_FILE }} .env - - name: Dotenv action - uses: falti/dotenv-action@v1.0.4 - id: dotenv - - name: Extract variables - shell: bash - run: | - echo "RACK_ENV=${{ env.RACK_ENV }}" >> $GITHUB_OUTPUT - echo "ENV_FILE=${{ env.ENV_FILE }}" >> $GITHUB_OUTPUT - echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_OUTPUT - echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "TAG=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "GIT_SHA=${{ github.sha }}" >> $GITHUB_OUTPUT - echo "GIT_SHA_SHORT=$( git rev-parse --short ${{ github.sha }} )" >> $GITHUB_OUTPUT - echo "LATEST_RELEASE=${{ steps.octokit.outputs.tag }}" >> $GITHUB_OUTPUT - echo "SITE_NAME=${{ steps.dotenv.outputs.SITE_NAME }}" >> $GITHUB_OUTPUT - echo "SITE_URL=${{ steps.dotenv.outputs.SITE_URL }}" >> $GITHUB_OUTPUT - id: extract_variables - - name: Print state - run: | - echo "RACK_ENV = ${{ steps.extract_variables.outputs.RACK_ENV }}" - echo "ENV_FILE = ${{ steps.extract_variables.outputs.ENV_FILE }}" - echo "REPOSITORY = ${{ steps.extract_variables.outputs.REPOSITORY }}" - echo "BRANCH = ${{ steps.extract_variables.outputs.BRANCH }}" - echo "GIT_SHA = ${{ steps.extract_variables.outputs.GIT_SHA }}" - build: - needs: [vars] uses: ./.github/workflows/_build.yml with: - RACK_ENV: ${{ needs.vars.outputs.RACK_ENV }} - ENV_FILE: ${{ needs.vars.outputs.ENV_FILE }} - REPOSITORY: ${{ needs.vars.outputs.REPOSITORY }} - BRANCH: ${{ needs.vars.outputs.BRANCH }} - GIT_SHA: ${{ needs.vars.outputs.GIT_SHA }} - + RACK_ENV: ${{ env.RACK_ENV }} + ENV_FILE: ${{ env.ENV_FILE }} + GIT_SHA: ${{ github.sha }} + deploy: - needs: [vars, build] + needs: [build] uses: ./.github/workflows/_deploy.yml with: - RACK_ENV: ${{ needs.vars.outputs.RACK_ENV }} - ENV_FILE: ${{ needs.vars.outputs.ENV_FILE }} - REPOSITORY: ${{ needs.vars.outputs.REPOSITORY }} - BRANCH: ${{ needs.vars.outputs.BRANCH }} - GIT_SHA: ${{ needs.vars.outputs.GIT_SHA }} + RACK_ENV: ${{ env.RACK_ENV }} + ENV_FILE: ${{ env.ENV_FILE }} + GIT_SHA: ${{ github.sha }} secrets: S3_BUCKET: ${{ secrets.STAGE_S3_BUCKET }} S3_REGION: ${{ secrets.STAGE_S3_BUCKET_REGION }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index bece8f1..1ac4a26 100755 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,63 +10,9 @@ env: ENV_FILE: .env.stage jobs: - vars: - runs-on: ubuntu-latest - outputs: - RACK_ENV: ${{ steps.extract_variables.outputs.RACK_ENV }} - ENV_FILE: ${{ steps.extract_variables.outputs.ENV_FILE }} - REPOSITORY: ${{ steps.extract_variables.outputs.REPOSITORY }} - BRANCH: ${{ steps.extract_variables.outputs.BRANCH }} - TAG: ${{ steps.extract_variables.outputs.TAG }} - GIT_SHA: ${{ steps.extract_variables.outputs.GIT_SHA }} - GIT_SHA_SHORT: ${{ steps.extract_variables.outputs.GIT_SHA_SHORT }} - LATEST_RELEASE: ${{ steps.extract_variables.outputs.LATEST_RELEASE }} - SITE_URL: ${{ steps.extract_variables.outputs.SITE_URL }} - SITE_NAME: ${{ steps.extract_variables.outputs.SITE_NAME }} - steps: - - name: Git checkout - uses: actions/checkout@v3 - - name: Get latest release tag - uses: oprypin/find-latest-tag@v1 - with: - repository: ${{ github.repository }} - releases-only: true - id: octokit - - name: GET .env - run: | - cp ${{ env.ENV_FILE }} .env - - name: Dotenv action - uses: falti/dotenv-action@v1.0.4 - id: dotenv - - name: Extract variables - shell: bash - run: | - echo "RACK_ENV=${{ env.RACK_ENV }}" >> $GITHUB_OUTPUT - echo "ENV_FILE=${{ env.ENV_FILE }}" >> $GITHUB_OUTPUT - echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_OUTPUT - echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "TAG=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "GIT_SHA=${{ github.sha }}" >> $GITHUB_OUTPUT - echo "GIT_SHA_SHORT=$( git rev-parse --short ${{ github.sha }} )" >> $GITHUB_OUTPUT - echo "LATEST_RELEASE=${{ steps.octokit.outputs.tag }}" >> $GITHUB_OUTPUT - echo "SITE_NAME=${{ steps.dotenv.outputs.SITE_NAME }}" >> $GITHUB_OUTPUT - echo "SITE_URL=${{ steps.dotenv.outputs.SITE_URL }}" >> $GITHUB_OUTPUT - id: extract_variables - - name: Print state - run: | - echo "RACK_ENV = ${{ steps.extract_variables.outputs.RACK_ENV }}" - echo "ENV_FILE = ${{ steps.extract_variables.outputs.ENV_FILE }}" - echo "REPOSITORY = ${{ steps.extract_variables.outputs.REPOSITORY }}" - echo "BRANCH = ${{ steps.extract_variables.outputs.BRANCH }}" - echo "GIT_SHA = ${{ steps.extract_variables.outputs.GIT_SHA }}" - build: - needs: [vars] uses: ./.github/workflows/_build.yml with: - RACK_ENV: ${{ needs.vars.outputs.RACK_ENV }} - ENV_FILE: ${{ needs.vars.outputs.ENV_FILE }} - REPOSITORY: ${{ needs.vars.outputs.REPOSITORY }} - BRANCH: ${{ needs.vars.outputs.BRANCH }} - GIT_SHA: ${{ needs.vars.outputs.GIT_SHA }} - \ No newline at end of file + RACK_ENV: ${{ env.RACK_ENV }} + ENV_FILE: ${{ env.ENV_FILE }} + GIT_SHA: ${{ github.sha }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 12398a7..8388b33 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,82 +2,26 @@ name: Release to Production on: release: types: [published] - + env: RACK_ENV: production ENV_FILE: .env.production jobs: - vars: - runs-on: ubuntu-latest - outputs: - RACK_ENV: ${{ steps.extract_variables.outputs.RACK_ENV }} - ENV_FILE: ${{ steps.extract_variables.outputs.ENV_FILE }} - REPOSITORY: ${{ steps.extract_variables.outputs.REPOSITORY }} - BRANCH: ${{ steps.extract_variables.outputs.BRANCH }} - TAG: ${{ steps.extract_variables.outputs.TAG }} - GIT_SHA: ${{ steps.extract_variables.outputs.GIT_SHA }} - GIT_SHA_SHORT: ${{ steps.extract_variables.outputs.GIT_SHA_SHORT }} - LATEST_RELEASE: ${{ steps.extract_variables.outputs.LATEST_RELEASE }} - SITE_URL: ${{ steps.extract_variables.outputs.SITE_URL }} - SITE_NAME: ${{ steps.extract_variables.outputs.SITE_NAME }} - steps: - - name: Git checkout - uses: actions/checkout@v3 - - name: Get latest release tag - uses: oprypin/find-latest-tag@v1 - with: - repository: ${{ github.repository }} - releases-only: true - id: octokit - - name: GET .env - run: | - cp ${{ env.ENV_FILE }} .env - - name: Dotenv action - uses: falti/dotenv-action@v1.0.4 - id: dotenv - - name: Extract variables - shell: bash - run: | - echo "RACK_ENV=${{ env.RACK_ENV }}" >> $GITHUB_OUTPUT - echo "ENV_FILE=${{ env.ENV_FILE }}" >> $GITHUB_OUTPUT - echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_OUTPUT - echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "TAG=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "GIT_SHA=${{ github.sha }}" >> $GITHUB_OUTPUT - echo "GIT_SHA_SHORT=$( git rev-parse --short ${{ github.sha }} )" >> $GITHUB_OUTPUT - echo "LATEST_RELEASE=${{ steps.octokit.outputs.tag }}" >> $GITHUB_OUTPUT - echo "SITE_NAME=${{ steps.dotenv.outputs.SITE_NAME }}" >> $GITHUB_OUTPUT - echo "SITE_URL=${{ steps.dotenv.outputs.SITE_URL }}" >> $GITHUB_OUTPUT - id: extract_variables - - name: Print state - run: | - echo "RACK_ENV = ${{ steps.extract_variables.outputs.RACK_ENV }}" - echo "ENV_FILE = ${{ steps.extract_variables.outputs.ENV_FILE }}" - echo "REPOSITORY = ${{ steps.extract_variables.outputs.REPOSITORY }}" - echo "BRANCH = ${{ steps.extract_variables.outputs.BRANCH }}" - echo "GIT_SHA = ${{ steps.extract_variables.outputs.GIT_SHA }}" - build: - needs: [vars] uses: ./.github/workflows/_build.yml with: - RACK_ENV: ${{ needs.vars.outputs.RACK_ENV }} - ENV_FILE: ${{ needs.vars.outputs.ENV_FILE }} - REPOSITORY: ${{ needs.vars.outputs.REPOSITORY }} - BRANCH: ${{ needs.vars.outputs.BRANCH }} - GIT_SHA: ${{ needs.vars.outputs.GIT_SHA }} - - # Note, we don't deploy to test. + RACK_ENV: ${{ env.RACK_ENV }} + ENV_FILE: ${{ env.ENV_FILE }} + GIT_SHA: ${{ github.sha }} + deploy: - needs: [vars, build] + needs: [build] uses: ./.github/workflows/_deploy.yml with: - RACK_ENV: ${{ needs.vars.outputs.RACK_ENV }} - ENV_FILE: ${{ needs.vars.outputs.ENV_FILE }} - REPOSITORY: ${{ needs.vars.outputs.REPOSITORY }} - BRANCH: ${{ needs.vars.outputs.BRANCH }} - GIT_SHA: ${{ needs.vars.outputs.GIT_SHA }} + RACK_ENV: ${{ env.RACK_ENV }} + ENV_FILE: ${{ env.ENV_FILE }} + GIT_SHA: ${{ github.sha }} secrets: S3_BUCKET: ${{ secrets.S3_BUCKET }} S3_REGION: ${{ secrets.S3_BUCKET_REGION }} diff --git a/.github/workflows/test_branch.yml b/.github/workflows/test_branch.yml index f9bda4a..f91022f 100755 --- a/.github/workflows/test_branch.yml +++ b/.github/workflows/test_branch.yml @@ -1,68 +1,15 @@ name: Test Branch on: workflow_dispatch: - + env: RACK_ENV: stage ENV_FILE: .env.stage jobs: - vars: - runs-on: ubuntu-latest - outputs: - RACK_ENV: ${{ steps.extract_variables.outputs.RACK_ENV }} - ENV_FILE: ${{ steps.extract_variables.outputs.ENV_FILE }} - REPOSITORY: ${{ steps.extract_variables.outputs.REPOSITORY }} - BRANCH: ${{ steps.extract_variables.outputs.BRANCH }} - TAG: ${{ steps.extract_variables.outputs.TAG }} - GIT_SHA: ${{ steps.extract_variables.outputs.GIT_SHA }} - GIT_SHA_SHORT: ${{ steps.extract_variables.outputs.GIT_SHA_SHORT }} - LATEST_RELEASE: ${{ steps.extract_variables.outputs.LATEST_RELEASE }} - SITE_URL: ${{ steps.extract_variables.outputs.SITE_URL }} - SITE_NAME: ${{ steps.extract_variables.outputs.SITE_NAME }} - steps: - - name: Git checkout - uses: actions/checkout@v3 - - name: Get latest release tag - uses: oprypin/find-latest-tag@v1 - with: - repository: ${{ github.repository }} - releases-only: true - id: octokit - - name: GET .env - run: | - cp ${{ env.ENV_FILE }} .env - - name: Dotenv action - uses: falti/dotenv-action@v1.0.4 - id: dotenv - - name: Extract variables - shell: bash - run: | - echo "RACK_ENV=${{ env.RACK_ENV }}" >> $GITHUB_OUTPUT - echo "ENV_FILE=${{ env.ENV_FILE }}" >> $GITHUB_OUTPUT - echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_OUTPUT - echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "TAG=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "GIT_SHA=${{ github.sha }}" >> $GITHUB_OUTPUT - echo "GIT_SHA_SHORT=$( git rev-parse --short ${{ github.sha }} )" >> $GITHUB_OUTPUT - echo "LATEST_RELEASE=${{ steps.octokit.outputs.tag }}" >> $GITHUB_OUTPUT - echo "SITE_NAME=${{ steps.dotenv.outputs.SITE_NAME }}" >> $GITHUB_OUTPUT - echo "SITE_URL=${{ steps.dotenv.outputs.SITE_URL }}" >> $GITHUB_OUTPUT - id: extract_variables - - name: Print state - run: | - echo "RACK_ENV = ${{ steps.extract_variables.outputs.RACK_ENV }}" - echo "ENV_FILE = ${{ steps.extract_variables.outputs.ENV_FILE }}" - echo "REPOSITORY = ${{ steps.extract_variables.outputs.REPOSITORY }}" - echo "BRANCH = ${{ steps.extract_variables.outputs.BRANCH }}" - echo "GIT_SHA = ${{ steps.extract_variables.outputs.GIT_SHA }}" - build: - needs: [vars] uses: ./.github/workflows/_build.yml with: - RACK_ENV: ${{ needs.vars.outputs.RACK_ENV }} - ENV_FILE: ${{ needs.vars.outputs.ENV_FILE }} - REPOSITORY: ${{ needs.vars.outputs.REPOSITORY }} - BRANCH: ${{ needs.vars.outputs.BRANCH }} - GIT_SHA: ${{ needs.vars.outputs.GIT_SHA }} + RACK_ENV: ${{ env.RACK_ENV }} + ENV_FILE: ${{ env.ENV_FILE }} + GIT_SHA: ${{ github.sha }} From 326e91b62488bfd116e0b0539b075644b1ef30a4 Mon Sep 17 00:00:00 2001 From: jrhoads Date: Thu, 19 Feb 2026 13:42:37 +0100 Subject: [PATCH 2/4] refactor: inline RACK_ENV and ENV_FILE variables in workflow files --- .github/workflows/branch_to_staging.yml | 12 ++++-------- .github/workflows/deploy.yml | 12 ++++-------- .github/workflows/release.yml | 8 ++++---- .github/workflows/test_branch.yml | 8 ++------ 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/.github/workflows/branch_to_staging.yml b/.github/workflows/branch_to_staging.yml index ca387d7..7d92f9d 100755 --- a/.github/workflows/branch_to_staging.yml +++ b/.github/workflows/branch_to_staging.yml @@ -2,24 +2,20 @@ name: Build/Deploy Branch to Staging on: workflow_dispatch: -env: - RACK_ENV: stage - ENV_FILE: .env.stage - jobs: build: uses: ./.github/workflows/_build.yml with: - RACK_ENV: ${{ env.RACK_ENV }} - ENV_FILE: ${{ env.ENV_FILE }} + RACK_ENV: stage + ENV_FILE: .env.stage GIT_SHA: ${{ github.sha }} deploy: needs: [build] uses: ./.github/workflows/_deploy.yml with: - RACK_ENV: ${{ env.RACK_ENV }} - ENV_FILE: ${{ env.ENV_FILE }} + RACK_ENV: stage + ENV_FILE: .env.stage GIT_SHA: ${{ github.sha }} secrets: S3_BUCKET: ${{ secrets.STAGE_S3_BUCKET }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 03e6c6d..4341000 100755 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,24 +4,20 @@ on: branches: - "master" -env: - RACK_ENV: stage - ENV_FILE: .env.stage - jobs: build: uses: ./.github/workflows/_build.yml with: - RACK_ENV: ${{ env.RACK_ENV }} - ENV_FILE: ${{ env.ENV_FILE }} + RACK_ENV: stage + ENV_FILE: .env.stage GIT_SHA: ${{ github.sha }} deploy: needs: [build] uses: ./.github/workflows/_deploy.yml with: - RACK_ENV: ${{ env.RACK_ENV }} - ENV_FILE: ${{ env.ENV_FILE }} + RACK_ENV: stage + ENV_FILE: .env.stage GIT_SHA: ${{ github.sha }} secrets: S3_BUCKET: ${{ secrets.STAGE_S3_BUCKET }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8388b33..d990741 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,16 +11,16 @@ jobs: build: uses: ./.github/workflows/_build.yml with: - RACK_ENV: ${{ env.RACK_ENV }} - ENV_FILE: ${{ env.ENV_FILE }} + RACK_ENV: production + ENV_FILE: .env.production GIT_SHA: ${{ github.sha }} deploy: needs: [build] uses: ./.github/workflows/_deploy.yml with: - RACK_ENV: ${{ env.RACK_ENV }} - ENV_FILE: ${{ env.ENV_FILE }} + RACK_ENV: production + ENV_FILE: .env.production GIT_SHA: ${{ github.sha }} secrets: S3_BUCKET: ${{ secrets.S3_BUCKET }} diff --git a/.github/workflows/test_branch.yml b/.github/workflows/test_branch.yml index f91022f..0d60248 100755 --- a/.github/workflows/test_branch.yml +++ b/.github/workflows/test_branch.yml @@ -2,14 +2,10 @@ name: Test Branch on: workflow_dispatch: -env: - RACK_ENV: stage - ENV_FILE: .env.stage - jobs: build: uses: ./.github/workflows/_build.yml with: - RACK_ENV: ${{ env.RACK_ENV }} - ENV_FILE: ${{ env.ENV_FILE }} + RACK_ENV: stage + ENV_FILE: .env.stage GIT_SHA: ${{ github.sha }} From 695f7f8865352bb902f60c5d745fa882d35275fa Mon Sep 17 00:00:00 2001 From: jrhoads Date: Thu, 19 Feb 2026 14:12:05 +0100 Subject: [PATCH 3/4] refactor: replace s3-deploy action with aws cli sync and invalidation --- .github/workflows/_deploy.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/_deploy.yml b/.github/workflows/_deploy.yml index 51cc76d..9729a66 100755 --- a/.github/workflows/_deploy.yml +++ b/.github/workflows/_deploy.yml @@ -34,11 +34,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install Node - uses: actions/setup-node@v4 - with: - node-version: '14' - - name: Get cached build uses: actions/cache@v4 with: @@ -47,13 +42,9 @@ jobs: restore-keys: | assets-build-${{ inputs.GIT_SHA }}-${{ inputs.RACK_ENV }} - # It is important that delete-removed = false for now. - - name: Deploy Build - uses: reggionick/s3-deploy@master - with: - folder: build - bucket: ${{ secrets.S3_BUCKET }} - bucket-region: ${{ secrets.S3_REGION }} - dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} - invalidation: / - delete-removed: false + # It is important that we do NOT use --delete (matches previous delete-removed: false) + - name: Sync build to S3 + run: aws s3 sync build s3://${{ secrets.S3_BUCKET }} --region ${{ secrets.S3_REGION }} + + - name: Invalidate CloudFront + run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" From c4136e7d445fa03361afd86f2106a6c686a81eff Mon Sep 17 00:00:00 2001 From: jrhoads Date: Thu, 19 Feb 2026 14:18:20 +0100 Subject: [PATCH 4/4] refactor: inline environment variables in workflow build jobs --- .github/workflows/pull_request.yml | 8 ++------ .github/workflows/release.yml | 4 ---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1ac4a26..b243e4b 100755 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,14 +5,10 @@ on: branches: - master -env: - RACK_ENV: stage - ENV_FILE: .env.stage - jobs: build: uses: ./.github/workflows/_build.yml with: - RACK_ENV: ${{ env.RACK_ENV }} - ENV_FILE: ${{ env.ENV_FILE }} + RACK_ENV: stage + ENV_FILE: .env.stage GIT_SHA: ${{ github.sha }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d990741..89a147f 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,10 +3,6 @@ on: release: types: [published] -env: - RACK_ENV: production - ENV_FILE: .env.production - jobs: build: uses: ./.github/workflows/_build.yml