-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (45 loc) · 1.42 KB
/
close-pr.yml
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
34
35
36
37
38
39
40
41
42
43
44
45
name: close-pr
permissions:
contents: read
id-token: write
on:
pull_request:
types:
- closed
env:
ENVIRONMENT_ID: pr-${{ github.event.number }}
IMAGE_NAME: ${{ secrets.REGISTRY_LOCATION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REGISTRY_NAME }}/my-sample-workload
HUMCTL_VERSION: '*'
jobs:
ob-pr-closed:
runs-on: ubuntu-22.04
steps:
- name: install humctl
uses: humanitec/setup-cli-action@v1
with:
version: ${{ env.HUMCTL_VERSION }}
- name: delete humanitec env
run: |
humctl delete env ${{ env.ENVIRONMENT_ID }} \
--token ${{ secrets.HUMANITEC_TOKEN }} \
--org ${{ secrets.HUMANITEC_ORG }} \
--app ${{ vars.APP_NAME }} \
|| true
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: '${{ secrets.WI_PROVIDER_ID }}'
service_account: '${{ secrets.GSA_ID }}'
- uses: google-github-actions/setup-gcloud@v2
with:
version: latest
- name: sign-in to gar
run: |
gcloud auth configure-docker \
${{ secrets.REGISTRY_LOCATION }}-docker.pkg.dev \
--quiet
- name: delete container image in gar
run: |
gcloud artifacts docker images delete \
${{ env.IMAGE_NAME }}:${{ env.ENVIRONMENT_ID }} \
--delete-tags \
--quiet