-
Notifications
You must be signed in to change notification settings - Fork 14
46 lines (36 loc) · 1.4 KB
/
main.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
name: Release, Build, and Push Chart
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run Helm Chart Releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Setup Helm
uses: azure/setup-helm@v3
- name: Package Helm Chart
run: |
cd charts/cluster-templates
helm package .
- name: Get Tag Name
id: get_tag
run: echo ::set-output name=tag::$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Push Helm Chart Release to GitHub Container Registry
run: |
docker tag rancher-cluster-templates-${{ steps.get_tag.outputs.tag }}.tgz ghcr.io/${{ github.repository_owner }}/rancher-cluster-templates:${{ steps.get_tag.outputs.tag }}
docker push ghcr.io/${{ github.repository_owner }}/rancher-cluster-templates:${{ steps.get_tag.outputs.tag }}