-
Notifications
You must be signed in to change notification settings - Fork 610
106 lines (93 loc) · 2.58 KB
/
release-charts.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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release charts
on:
# push:
# branches:
# - master
# paths:
# - 'charts/**'
schedule:
# every friday at 4 o'clock
- cron: '0 16 * * 5'
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
bump-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Bump Keycloak
uses: ./.github/actions/bumpVersionAction
with:
chart: keycloak
- name: Bump Keycloak.X
uses: ./.github/actions/bumpVersionAction
with:
chart: keycloakx
- name: Bump Mailhog
uses: ./.github/actions/bumpVersionAction
with:
chart: mailhog
- name: Push Results
id: pushResults
run: |
if git merge-base --is-ancestor HEAD @{u} ; then
echo "publish=false" >> $GITHUB_OUTPUT
echo "No push necesarry"
else
echo "Version bumps happened. Pushing now..."
git push
echo "publish=true" >> $GITHUB_OUTPUT
fi
outputs:
publish: ${{ steps.pushResults.outputs.publish }}
upload:
runs-on: ubuntu-latest
needs:
- bump-versions
# if: needs.bump-versions.outputs.publish == 'true'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git pull
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.16.3
- name: Add dependency chart repos
run: |
helm repo add bitnami https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Release charts
uses: helm/[email protected]
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Push Chart to GHCR
run: |
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" oci://ghcr.io/${{ github.repository }}
done