From 9dd49a0023e14ea2cef01ea82f38cfbe82fb8e5b Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Mon, 20 Jun 2022 15:16:51 -0400 Subject: [PATCH] Update workflows to deploy to CloudFlare Pages (cf-pages branch) (#2936) --- .github/workflows/build-browser.yml | 2 +- .github/workflows/build-cli.yml | 2 +- .github/workflows/build-desktop.yml | 2 +- .github/workflows/build-web.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/release-web.yml | 75 +---------------------------- 6 files changed, 7 insertions(+), 78 deletions(-) diff --git a/.github/workflows/build-browser.yml b/.github/workflows/build-browser.yml index 44e75de64b..aae0348923 100644 --- a/.github/workflows/build-browser.yml +++ b/.github/workflows/build-browser.yml @@ -5,7 +5,7 @@ on: pull_request: branches-ignore: - 'l10n_master' - - 'gh-pages' + - 'cf-pages' paths: - 'apps/browser/**' - 'libs/**' diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 09fe1b199c..ee56ed5be4 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -5,7 +5,7 @@ on: pull_request: branches-ignore: - 'l10n_master' - - 'gh-pages' + - 'cf-pages' paths: - 'apps/cli/**' - 'libs/**' diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml index 6170119723..b6ca6833f3 100644 --- a/.github/workflows/build-desktop.yml +++ b/.github/workflows/build-desktop.yml @@ -5,7 +5,7 @@ on: pull_request: branches-ignore: - 'l10n_master' - - 'gh-pages' + - 'cf-pages' paths: - 'apps/desktop/**' - '*' diff --git a/.github/workflows/build-web.yml b/.github/workflows/build-web.yml index 0c1ad68dac..6f3ffb1257 100644 --- a/.github/workflows/build-web.yml +++ b/.github/workflows/build-web.yml @@ -5,7 +5,7 @@ on: pull_request: branches-ignore: - 'l10n_master' - - 'gh-pages' + - 'cf-pages' paths: - 'apps/web/**' - 'libs/**' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9c1ff9b064..0e736752b8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,7 +5,7 @@ on: push: branches-ignore: - 'l10n_master' - - 'gh-pages' + - 'cf-pages' paths-ignore: - '.github/workflows/**' workflow_dispatch: diff --git a/.github/workflows/release-web.yml b/.github/workflows/release-web.yml index 4b508bfee6..0468aeab67 100644 --- a/.github/workflows/release-web.yml +++ b/.github/workflows/release-web.yml @@ -142,73 +142,6 @@ jobs: run: docker logout - ghpages-deploy: - name: Deploy Web Vault to GitHub Pages - runs-on: ubuntu-20.04 - needs: - - setup - - self-host - env: - _RELEASE_VERSION: ${{ needs.setup.outputs.release_version }} - _TAG_VERSION: ${{ needs.setup.outputs.tag_version }} - steps: - - name: Checkout Repo - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 # v2.4.0 - with: - ref: gh-pages - - - name: Create gh-pages-deploy branch - run: | - git switch -c gh-pages-deploy-$_TAG_VERSION - git push -u origin gh-pages-deploy-$_TAG_VERSION - - - name: Checkout Repo - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 # v2.4.0 - - - name: Setup git config - run: | - git config user.name = "GitHub Action Bot" - git config user.email = "<>" - git config --global url."https://github.com/".insteadOf ssh://git@github.com/ - git config --global url."https://".insteadOf ssh:// - - - name: Download latest cloud asset - uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 - with: - workflow: build-web.yml - path: apps/web - workflow_conclusion: success - branch: ${{ needs.setup.outputs.branch_name }} - artifacts: web-*-cloud-COMMERCIAL.zip - - # This should result in a build directory in the current working directory - - name: Unzip build asset - working-directory: apps/web - run: unzip web-*-cloud-COMMERCIAL.zip - - - name: Deploy GitHub Pages - uses: crazy-max/ghaction-github-pages@eb08c35b9fab86751edfff4e55cd5cde35ff0e52 # v3.0.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - target_branch: gh-pages-deploy-${{ needs.setup.outputs.tag_version }} - build_dir: apps/web/build - keep_history: true - commit_message: "Staging deploy ${{ needs.setup.outputs.release_version }}" - dry_run: ${{ github.event.inputs.release_type == 'Dry Run' }} - - - name: Create GitHub Pages Deploy PR - if: ${{ github.event.inputs.release_type != 'Dry Run' }} - env: - PR_BRANCH: gh-pages-deploy-${{ env._TAG_VERSION }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr create --title "Deploy $_RELEASE_VERSION to GitHub Pages" \ - --body "Deploying $_RELEASE_VERSION" \ - --base gh-pages \ - --head "$PR_BRANCH" - - cfpages-deploy: name: Deploy Web Vault to CloudFlare Pages branch runs-on: ubuntu-20.04 @@ -239,7 +172,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 with: - ref: deploy + ref: cf-pages path: deployment - name: Setup git config @@ -271,7 +204,7 @@ jobs: run: | gh pr create --title "Deploy $_RELEASE_VERSION to CloudFlare Pages" \ --body "Deploying $_RELEASE_VERSION" \ - --base deploy \ + --base cf-pages \ --head "$PR_BRANCH" @@ -281,7 +214,6 @@ jobs: needs: - setup - self-host - - ghpages-deploy - cfpages-deploy steps: - name: Download latest build artifacts @@ -327,8 +259,5 @@ jobs: - name: Checkout repo uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - - name: Remove gh-pages-deploy branch - run: git push origin --delete gh-pages-deploy-$_TAG_VERSION - - name: Remove cf-pages-deploy branch run: git push origin --delete cf-pages-deploy-$_TAG_VERSION