From e9b2dccfce17b39c4df70f9b14fe62ef9ed02424 Mon Sep 17 00:00:00 2001 From: bengo <171782+gobengo@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:14:13 -0800 Subject: [PATCH 1/3] ci: .github/workflows/api.yml when using wrangler-action passes with.vars so that the env vars like NEXT_PUBLIC_W3UP_LAUNCH_ get added to cf worker vars --- .github/workflows/api.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index c146fdb1b9..d8220734ce 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -76,6 +76,10 @@ jobs: apiToken: ${{ secrets.CF_TOKEN }} workingDirectory: 'packages/api' environment: 'staging' + vars: | + NEXT_PUBLIC_W3UP_LAUNCH_LIMITED_AVAILABILITY_START + NEXT_PUBLIC_W3UP_LAUNCH_SUNSET_ANNOUNCEMENT_START + NEXT_PUBLIC_W3UP_LAUNCH_SUNSET_START - name: Test upload to staging run: | npm run build -w packages/client @@ -112,3 +116,7 @@ jobs: apiToken: ${{ secrets.CF_TOKEN }} workingDirectory: 'packages/api' environment: 'production' + vars: | + NEXT_PUBLIC_W3UP_LAUNCH_LIMITED_AVAILABILITY_START + NEXT_PUBLIC_W3UP_LAUNCH_SUNSET_ANNOUNCEMENT_START + NEXT_PUBLIC_W3UP_LAUNCH_SUNSET_START From a61f788e4f0304bee36e02e99a95e147cdd3403d Mon Sep 17 00:00:00 2001 From: bengo <171782+gobengo@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:35:21 -0800 Subject: [PATCH 2/3] ci: .github/workflows/api.yml has workflow_dispatch manual trigger --- .github/workflows/api.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index d8220734ce..9e8aa2e544 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -14,6 +14,19 @@ on: - 'packages/db/**' - '.github/workflows/api.yml' - 'package-lock.json' + workflow_dispatch: + inputs: + force_deploy_staging: + description: whether to deploy to staging even if the job wouldn't normally run + required: true + type: boolean + default: false + force_deploy_production: + description: whether to deploy to production even if the job wouldn't normally run + required: true + type: boolean + default: false + jobs: test: runs-on: ubuntu-latest @@ -52,7 +65,7 @@ jobs: deploy-staging: name: Deploy Staging - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || inputs.force_deploy_staging runs-on: ubuntu-latest needs: test environment: @@ -88,7 +101,7 @@ jobs: deploy-production: name: Deploy Production - if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changelog.outputs.releases_created) || inputs.force_release + if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changelog.outputs.releases_created) || inputs.force_deploy_production runs-on: ubuntu-latest needs: - test From 39b2f99635e320d763d27c42f6c1943ce40a4998 Mon Sep 17 00:00:00 2001 From: bengo <171782+gobengo@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:38:33 -0800 Subject: [PATCH 3/3] lint --- packages/api/test/user.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api/test/user.spec.js b/packages/api/test/user.spec.js index 2038ba3598..5945b7c64c 100644 --- a/packages/api/test/user.spec.js +++ b/packages/api/test/user.spec.js @@ -570,7 +570,7 @@ describe('userLoginPost', function () { }) it('should not create new users once date is after NEXT_PUBLIC_W3UP_LAUNCH_LIMITED_AVAILABILITY_START', async function () { - if ( ! process.env.CI_DONT_ACCOMODATE_LONG_TESTS) { + if (!process.env.CI_DONT_ACCOMODATE_LONG_TESTS) { // this times out on CI in the default 5 seconds. // It's not surprising this may take some time, since it relies on creating a whole new miniflare server. this.timeout(60 * 1000)