From f1ca56a60bbcd5263414011472ba18096aaea584 Mon Sep 17 00:00:00 2001 From: Benjamin Goering <171782+gobengo@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:14:48 -0800 Subject: [PATCH] ci: .github/workflows/deploy.yml preview job sets gh environment (#18) Motivation * https://github.com/web3-storage/console/issues/17 * make preview environments easier to find by having our github workflow files use the `environment` affordance to record when it deploys preview/staging environments to cloudflare pages. That way they will be browsable/clickable in the GitHub UI at https://github.com/web3-storage/console/deployments note * [x] wait for cloudflare to not be down to ensure the CI workflow will then pass https://github.com/web3-storage/console/pull/20 --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3e55038..f8d931c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,6 +14,9 @@ jobs: needs: - test runs-on: ubuntu-latest + environment: + name: ${{ (github.ref_name == 'main') && 'staging' || format('preview-{0}', github.ref_name) }} + url: ${{ (github.ref_name == 'main') && 'https://staging.console.web3.storage/' || steps.cloudflare_url.outputs.stdout }} steps: - uses: actions/checkout@v3 - uses: ./.github/actions/pnpm