Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix preview channels for pr #29

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}"