Merge pull request #1245 from brenix/brenix-patch-1 #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)" |