-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.38 KB
/
release-build.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
name: Flux Push OCI Release
on:
push:
branches:
- 'main'
tags:
- 'release/*'
jobs:
flux:
env:
IMAGE: ghcr.io/kingdonb/river-data-explorer-config
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# - uses: actions/setup-go@v4
# with:
# go-version: '^1.17.0'
# Use Flux to publish mkdocs build output as OCI
- name: Setup Flux CLI
uses: fluxcd/flux2/action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Harvest the GIT_TAG in case this is a tag, for OCI
- name: Prepare
id: prep
run: |
GIT_TAG=${GITHUB_REF/refs\/tags\/release\//}
echo GIT_TAG=${GIT_TAG} >> $GITHUB_OUTPUT
- name: Login to GHCR
uses: docker/login-action@v2
if: github.event_name == 'push' && github.ref_type == 'tag'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Flux push OCI Repository
id: oci_push
if: github.event_name == 'push' && github.ref_type == 'tag'
run: |
flux push artifact oci://${{ env.IMAGE }}:${{ steps.prep.outputs.GIT_TAG }} \
--path="./deploy" \
--source="$(git config --get remote.origin.url)" \
--revision="$(git branch --show-current)/$(git rev-parse HEAD)"