-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (45 loc) · 1.25 KB
/
push-artifact.yaml
File metadata and controls
47 lines (45 loc) · 1.25 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
name: push-artifact
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'k8s/**'
jobs:
flux-push:
strategy:
fail-fast: false
matrix:
component:
- manifests
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # for pushing
id-token: write # for signing
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install flux
uses: controlplaneio-fluxcd/distribution/actions/setup@main
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push artifact
uses: controlplaneio-fluxcd/distribution/actions/push@main
id: push
with:
repository: ghcr.io/${{ github.repository }}/${{ matrix.component }}
path: "./k8s/${{ matrix.component }}"
diff-tag: latest
- name: Sign artifact
if: steps.push.outputs.pushed == 'true'
run: cosign sign --yes $DIGEST_URL
env:
DIGEST_URL: ${{ steps.push.outputs.digest-url }}