-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 1.24 KB
/
shutdown-preview.yml
File metadata and controls
33 lines (28 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: shutdown-preview
on:
pull_request:
types: [closed]
branches: [main]
jobs:
shutdown-preview:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'deploy-preview')
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
id-token: write
pull-requests: write
environment: development
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Google Auth
uses: 'google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093' # v3.0.0
with:
workload_identity_provider: 'projects/348931464772/locations/global/workloadIdentityPools/github-actions-pool/providers/github-deploy'
service_account: 'github-actions@blog-lacolaco-net.iam.gserviceaccount.com'
- name: 'Set up Cloud SDK'
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1
# https://cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration?hl=ja#remove-tags
- name: Remove revision tag from Cloud Run service
run: |
gcloud run services update-traffic web --region asia-northeast1 --remove-tags pr-${{ github.event.number }}