forked from twuni/docker-registry.helm
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.88 KB
/
helm_release.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
name: Release Charts
env:
HELM_VERSION_TO_INSTALL: 3.14.0
GCR_IMAGE: ghcr.io/${{ github.repository_owner }}/docker-registry
on:
workflow_dispatch:
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install chart-releaser
uses: helm/[email protected]
with:
install_only: true
# - name: Run chart-releaser
# env:
# CR_TOKEN: "${{ secrets.CR_TOKEN }}"
# run: |
# owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
# repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
# cr package
# cr upload --owner="$owner" --git-repo "$repo" --token="$CR_TOKEN" --release-name-template="v{{ .Version }}" --packages-with-index --push --skip-existing --generate-release-notes --commit main
# cr index --owner="$owner" --git-repo "$repo" --token="$CR_TOKEN" --release-name-template="v{{ .Version }}" --packages-with-index --push --index-path="."
#
- name: install helm
uses: Azure/setup-helm@v1
with:
# Version of helm
version: ${{ env.HELM_VERSION_TO_INSTALL }} # default is latest
- name: login to acr using helm
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ env.GCR_IMAGE }} --username ${{ github.repository_owner }} --password-stdin
- name: save helm chart to local registry
run: |
helm package ${{ github.workspace }}/
ls
- name: publish chart to acr
run: |
helm push dockery-registry-{{ .Version }}.tgz ${{ env.GCR_IMAGE }}:${{ .Version }}