-
Notifications
You must be signed in to change notification settings - Fork 90
75 lines (66 loc) · 2.4 KB
/
Copy pathrelease-agent-chart.yaml
File metadata and controls
75 lines (66 loc) · 2.4 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
73
74
75
name: Release agent Helm chart
on:
push:
branches:
- main
paths:
- 'install/helm-repo/argocd-agent-agent/**'
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: read
jobs:
release-agent-chart:
name: Package, push, and sign agent Helm chart
if: github.repository == 'argoproj-labs/argocd-agent'
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
id-token: write
outputs:
digest: ${{ steps.release.outputs.digest }}
chart_version: ${{ steps.release.outputs.chart_version }}
chart_ref: ${{ steps.release.outputs.chart_ref }}
pushed: ${{ steps.release.outputs.pushed }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install Helm
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
with:
version: v3.20.2
- name: Install Cosign
uses: sigstore/cosign-installer@ba7bc0a3fef59531c69a25acd34668d6d3fe6f22 # v4.1.0
- name: Login to GHCR
run: |
echo "${GITHUB_TOKEN}" | helm registry login ghcr.io --username "${GH_ACTOR}" --password-stdin
echo "${GITHUB_TOKEN}" | cosign login ghcr.io --username "${GH_ACTOR}" --password-stdin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ACTOR: ${{ github.actor }}
- name: Build and push Helm chart
id: release
run: ./hack/release-helm-chart.sh install/helm-repo/argocd-agent-agent "ghcr.io/${{ github.repository }}"
- name: Sign Helm chart with Cosign
if: steps.release.outputs.pushed == 'true'
run: |
cosign sign \
-a "repo=${{ github.repository }}" \
-a "workflow=${GITHUB_WORKFLOW}" \
-a "sha=${{ github.sha }}" \
-y \
${CHART_REF}@${DIGEST}
env:
CHART_REF: ${{ steps.release.outputs.chart_ref }}
DIGEST: ${{ steps.release.outputs.digest }}
- name: Upload chart package
if: steps.release.outputs.pushed == 'true'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: helm-chart-package
path: ${{ steps.release.outputs.package }}
retention-days: 1