forked from kubearmor/KubeArmor
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (64 loc) · 2.35 KB
/
ci-stable-release.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
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
name: ci-stable-release
on:
push:
branches: [main]
paths:
- "STABLE-RELEASE"
# - ".github/workflows/ci-stable-release.yml"
jobs:
push-stable-version:
name: Create KubeArmor stable release
if: github.repository == 'kubearmor/kubearmor'
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- name: Install regctl
run: |
curl -L https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64 >regctl
chmod 755 regctl
mv regctl /usr/local/bin
- name: Check install
run: regctl version
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_AUTHTOK }}
- name: Generate the stable version of KubeArmor in Docker Hub
run: |
STABLE_VERSION=`cat STABLE-RELEASE`
regctl image copy kubearmor/kubearmor:$STABLE_VERSION kubearmor/kubearmor:stable --digest-tags
update-helm-chart:
name: Update KubeArmor Helm chart version
if: github.repository == 'kubearmor/kubearmor'
runs-on: ubuntu-20.04
timeout-minutes: 20
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Update Chart.yaml
run: |
STABLE_VERSION=`cat STABLE-RELEASE`
sed -i -e "s/appVersion:.*/appVersion: $STABLE_VERSION/g" deployments/helm/Chart.yaml
sed -i -e "s/version:.*/version: $STABLE_VERSION/g" deployments/helm/Chart.yaml
- name: Commit updated chart to main
run: |
STABLE_VERSION=`cat STABLE-RELEASE`
git add deployments/helm/Chart.yaml
git config user.name $GITHUB_ACTOR
git config user.email $GITHUB_ACTOR@users.noreply.github.com
git commit -m "[Automated] Update Helm Chart To $STABLE_VERSION" --signoff
git push
- name: Publish Helm chart
uses: stefanprodan/helm-gh-pages@master
with:
# Access token which can push to a different repo in the same org
token: ${{ secrets.GH_ACCESS_TOKEN }}
charts_dir: deployments
# repo where charts would be published
owner: kubearmor
repository: charts
branch: gh-pages
charts_url: https://kubearmor.github.io/charts