Skip to content

Commit

Permalink
Fix preview channels for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
kvestus committed Feb 24, 2024
1 parent bf17e67 commit b16fdf6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/delete-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Delete PR preview website

on:
pull_request:
types: [ closed ]

jobs:
delete_preview_website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: w9jds/[email protected]
with:
# https://github.com/FirebaseExtended/action-hosting-deploy/issues/60
args: hosting:channel:list | awk -v pr_number="pr${{ github.event.pull_request.number }}" '$0 ~ pr_number { print $2 }' | xargs -I {} firebase hosting:channel:delete {} --force
env:
GCP_SA_KEY: "${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}"
PROJECT_ID: "${{ secrets.GOOGLE_PROJECT_ID }}"
16 changes: 0 additions & 16 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
environment: manual_e2e_tests
timeout-minutes: 15
runs-on: ubuntu-latest
if: github.event.pull_request.merged == false
container:
image: cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
options: --user 1001
Expand Down Expand Up @@ -100,7 +99,6 @@ jobs:
environment: manual_e2e_tests
timeout-minutes: 15
runs-on: ubuntu-latest
if: github.event.pull_request.merged == false
container:
image: cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
options: --user 1001
Expand Down Expand Up @@ -152,7 +150,6 @@ jobs:
environment: deploy_preview
needs: [ build ]
runs-on: ubuntu-latest
if: github.event.pull_request.merged == false
steps:
- name: Checkout repository
uses: actions/checkout@main
Expand All @@ -167,16 +164,3 @@ jobs:
firebaseServiceAccount: "${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}"
expires: 7d
projectId: "${{ secrets.GOOGLE_PROJECT_ID }}"

delete_preview_website:
runs-on: ubuntu-latest
if: github.event.action == 'closed' && github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v4
- uses: w9jds/[email protected]
with:
# https://github.com/FirebaseExtended/action-hosting-deploy/issues/60
args: hosting:channel:list | awk -v pr_number="pr${{ github.event.pull_request.number }}" '$0 ~ pr_number { print $2 }' | xargs -I {} firebase hosting:channel:delete {} --force
env:
GCP_SA_KEY: "${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}"
PROJECT_ID: "${{ secrets.GOOGLE_PROJECT_ID }}"

0 comments on commit b16fdf6

Please sign in to comment.