-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.01 KB
/
artifact.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
name: artifact
on:
push:
branches:
- 'main'
paths:
- deploy/**
permissions:
packages: write # needed for ghcr.io access
contents: write # needed for committing changes to PR
env:
OCI_REPO: "oci://ghcr.io/brenix/${{ github.event.repository.name }}"
jobs:
push-artifact:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flux CLI
uses: fluxcd/flux2/action@main
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push artifact
run: |
flux push artifact $OCI_REPO:main \
--path="./deploy" \
--source="$(git config --get remote.origin.url)" \
--revision="$(git branch --show-current)@sha1:$(git rev-parse HEAD)"