forked from opendatahub-io/caikit-tgis-serving
-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (44 loc) · 1.17 KB
/
pr-close-image-delete.yaml
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
46
name: Delete quay image on PR closed
on:
pull_request_target:
types: [closed]
branches:
- "main"
paths-ignore:
- "LICENSE"
- "**/.gitignore"
- "**.md"
- "**.adoc"
- "*.txt"
- "Makefile"
- ".github/**"
- "docs/**"
- "demo/**"
env:
QUAY_ODH_CAIKIT_TGIS_SERVING_IMAGE_REPO: ${{ secrets.QUAY_ODH_CAIKIT_TGIS_SERVING_IMAGE_REPO }}
jobs:
delete-pr-quay-image:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Install skopeo
shell: bash
run: |
sudo apt-get -y update
sudo apt-get -y install skopeo
- name: Login to quay.io
shell: bash
env:
QUAY_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }}
QUAY_ROBOT_USERNAME: ${{ secrets.QUAY_ROBOT_USERNAME }}
run: |
skopeo login quay.io -u "$QUAY_ROBOT_USERNAME" -p "$QUAY_TOKEN"
- name: Delete PR image
shell: bash
env:
PR: ${{ github.event.pull_request.number }}
run: |
skopeo delete docker://${QUAY_ODH_CAIKIT_TGIS_SERVING_IMAGE_REPO}:pr-${PR}