-
Notifications
You must be signed in to change notification settings - Fork 16
70 lines (62 loc) · 1.86 KB
/
nightly-chart-and-image-publish.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
name: Build and Publish nightly Helm chart and Docker images
on:
schedule:
- cron: "0 0 * * *" # Run every day at midnight (UTC)
workflow_dispatch: # Allow running manually on demand
env:
TAG: v0.0.0-${{ github.sha }}
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setupGo
uses: actions/setup-go@v4
with:
go-version: '=1.20.7'
- name: Docker login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker image
run: make docker-build-all TAG=${{ env.TAG }}
- name: Push docker image
run: make docker-push-all TAG=${{ env.TAG }}
release-helm:
name: Release Helm chart
needs:
- build
permissions:
contents: read
packages: write
env:
HELM_EXPERIMENTAL_OCI: 1
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install Helm
uses: Azure/setup-helm@v3
with:
version: 3.8.0
- name: Build Helm chart
run: make release-chart RELEASE_TAG=v0.0.0-${{ github.sha }}
- name: Login to ghcr.io using Helm
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.repository_owner }} --password-stdin
- name: Publish Helm chart to GHCR
env:
GHCR_REPOSITORY: ${{ github.repository_owner }}/rancher-turtles-chart
run: |
helm push out/package/rancher-turtles-0.0.0-${{ github.sha }}.tgz oci://ghcr.io/${{ github.repository_owner }}/rancher-turtles-chart