From f853ab70e7275c64558c5f5984c1c7932d1470bc Mon Sep 17 00:00:00 2001 From: Shane Fontaine <9441295+shanefontaine@users.noreply.github.com> Date: Sat, 18 May 2024 08:49:00 -0700 Subject: [PATCH 1/3] fe: bust --- packages/frontend/src/config/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/config/config.ts b/packages/frontend/src/config/config.ts index c3661aa165..958e3c8c26 100644 --- a/packages/frontend/src/config/config.ts +++ b/packages/frontend/src/config/config.ts @@ -9,7 +9,7 @@ if (process.env.REACT_APP_NETWORK === 'goerli') { showRewards = false } -const cacheBuster: number = 13 +const cacheBuster: number = 14 export { showRewards } From eff7433f64fbbd017e8913987287ef4ca538ff2a Mon Sep 17 00:00:00 2001 From: Shane Fontaine <9441295+shanefontaine@users.noreply.github.com> Date: Sat, 18 May 2024 12:05:09 -0700 Subject: [PATCH 2/3] gh: dynamic envs --- .github/workflows/ui-deploy.yml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ui-deploy.yml b/.github/workflows/ui-deploy.yml index f24f4a9e58..c7e424d01f 100644 --- a/.github/workflows/ui-deploy.yml +++ b/.github/workflows/ui-deploy.yml @@ -6,6 +6,9 @@ on: - production paths: - 'packages/frontend/**' +env: + PRODUCTION_ENVS: production + STAGING_ENVS: mainnet,sepolia jobs: publishable-packages: @@ -14,20 +17,35 @@ jobs: with: package-names: 'frontend' + publishable-environments: + name: Check for environment that can be published + outputs: + publishable-environments: ${{ steps.publishable-environments.outputs.publishable_environments }} + runs-on: ubuntu-latest + steps: + - name: Get environments + id: publishable-environments + run: | + if [ "${{ github.ref_name }}" == "production" ]; then + publishable_environments=${{ env.PRODUCTION_ENVS }} + else + publishable_environments=${{ env.STAGING_ENVS }} + fi + + # Format for matrix + publishable_environments=$(echo $publishable_environments | tr ',' '\n' | sed 's/^ *//;s/ *$//' | jq -R -s -c 'split("\n")[:-1]') + echo publishable_environments=$publishable_environments >> $GITHUB_OUTPUT + build-ui: name: Build and Deploy UI - needs: publishable-packages + needs: [publishable-packages, publishable-environments] runs-on: ubuntu-latest - # If the frontend hasn't been modified, skip if: ${{ fromJson(needs.publishable-packages.outputs.publishable-packages)[0] != '' }} environment: ${{ matrix.env-name }} strategy: matrix: package-name: ${{ fromJson(needs.publishable-packages.outputs.publishable-packages) }} - env-name: - - production - - mainnet - - sepolia + env-name: ${{ fromJson(needs.publishable-environments.outputs.publishable-environments) }} steps: - name: Checkout code uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b @@ -84,8 +102,6 @@ jobs: cidv0: ${{ steps.upload.outputs.hash }} - name: Create GitHub Release - # Only create a release on the production branch - if: matrix.env-name == 'production' env: CIDv0: ${{ steps.upload.outputs.hash }} CIDv1: ${{ steps.convert_cidv0.outputs.cidv1 }} From 197fc38d798fe3207722273672d94de78972eb9a Mon Sep 17 00:00:00 2001 From: Shane Fontaine <9441295+shanefontaine@users.noreply.github.com> Date: Sat, 18 May 2024 12:05:29 -0700 Subject: [PATCH 3/3] fe: bust --- packages/frontend/src/config/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/config/config.ts b/packages/frontend/src/config/config.ts index 958e3c8c26..a26bf57b7a 100644 --- a/packages/frontend/src/config/config.ts +++ b/packages/frontend/src/config/config.ts @@ -9,7 +9,7 @@ if (process.env.REACT_APP_NETWORK === 'goerli') { showRewards = false } -const cacheBuster: number = 14 +const cacheBuster: number = 15 export { showRewards }