-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (66 loc) · 2.37 KB
/
Copy pathedge.yml
File metadata and controls
72 lines (66 loc) · 2.37 KB
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
name: edge
# Continuous delivery: every push to main publishes a fresh installable
# "edge" image and OCI Helm chart, so CI/CD always produces new versions
# between tagged releases.
# image: ghcr.io/<owner>/apd:edge (+ :main-<sha>)
# chart: oci://ghcr.io/<owner>/charts/apd version <appVersion>-edge.<run>
on:
push:
branches: [main]
concurrency:
group: edge
cancel-in-progress: true
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/apd
tags: |
type=raw,value=edge
type=sha,prefix=main-
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max
chart:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: azure/setup-helm@v4
with:
version: v3.16.2
- name: Package and push edge OCI chart
run: |
set -euo pipefail
# OCI references must be lowercase; the org login name may be mixed-case.
OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
APP=$(awk '/^appVersion:/{gsub(/"/,"",$2); print $2}' charts/apd/Chart.yaml)
V="${APP}-edge.${GITHUB_RUN_NUMBER}"
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login "$REGISTRY" \
--username "${{ github.actor }}" --password-stdin
# app-version "edge" makes the chart default image.tag to :edge.
helm package charts/apd --version "$V" --app-version edge -d dist
helm push "dist/apd-${V}.tgz" "oci://${REGISTRY}/${OWNER}/charts"
echo "Pushed chart oci://${REGISTRY}/${OWNER}/charts/apd:${V}"