-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (73 loc) · 2.13 KB
/
pr-cleanup.yaml
File metadata and controls
81 lines (73 loc) · 2.13 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Pull Request Cleanup
on:
pull_request:
types: [closed]
workflow_dispatch:
inputs:
pr_number:
description: 'Optional PR number to use for cleanup'
required: false
type: string
env:
ORG: '${{ github.repository_owner }}'
PACKAGE_NAME: '${{ github.event.repository.name }}'
PACKAGE_TYPE: 'container'
TAG: >-
pr-${{ github.event.pull_request.number || inputs.pr_number }}
LOGIN_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
cleanup_helm:
runs-on: ubuntu-latest
env:
TRAINING_HELM_RELEASE: >-
pr-${{ github.event.pull_request.number || inputs.pr_number }}
TRAINING_NAMESPACE: 'pitc-cicd-gitlab-ci-cd-training-test'
KUBE_CONFIG_PATH: '$HOME/.kube'
KUBE_CONFIG_FILENAME: 'config'
steps:
- name: Checkout
uses: actions/checkout@v5
with:
sparse-checkout: |
scripts
sparse-checkout-cone-mode: false
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'latest'
- name: Install Kubectl
uses: azure/setup-kubectl@v4
with:
version: 'latest'
- name: Create KUBECONFIG
env:
KUBE_CONFIG: '${{ secrets.KUBECONFIG_TEST_AV2 }}'
run: bash ./scripts/create_kubeconfig.sh
- name: Remove PR Environment Helm Release
run: bash ./scripts/remove_helm_release.sh
cleanup_registry:
runs-on: ubuntu-latest
needs: cleanup_helm
steps:
- name: Checkout Repository
uses: actions/checkout@v5
with:
sparse-checkout: |
scripts
sparse-checkout-cone-mode: false
fetch-depth: 0
- name: Run registry cleanup script
run: bash ./scripts/cleanup_registry.sh
cleanup_signatures:
runs-on: ubuntu-latest
needs: cleanup_registry
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
sparse-checkout: |
scripts
sparse-checkout-cone-mode: false
fetch-depth: 0
- name: Run signatures cleanup script
run: bash ./scripts/cleanup_signatures.sh