-
Notifications
You must be signed in to change notification settings - Fork 8
45 lines (37 loc) · 1.27 KB
/
helm_delete_old_packages.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: Helm Delete Old Packages
on:
schedule:
- cron: "0 1 * * *"
jobs:
delete_old_packages:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: gh-pages
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.x
- name: Install Helm
env:
HELM_VERSION: v3.7.1
run: |
curl -LO https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz
tar -xvf helm-${HELM_VERSION}-linux-amd64.tar.gz --strip-components=1 linux-amd64/helm
rm helm-${HELM_VERSION}-linux-amd64.tar.gz
- name: Delete old packages and update Helm index
run: python .github/workflows/helm_delete_old_packages.py
- name: Update Helm index
run: |
helm repo index snapshot --url https://epam.github.io/edp-helm-charts/snapshot
rm helm
- name: Commit and push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "edp-bot"
git add .
git diff-index --quiet HEAD || git commit -m "Delete old packages of Helm charts" || (echo "No changes" && exit 0)
git push