Update Flux #34
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: Update Flux | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 1" # At 00:00 on Monday. | |
jobs: | |
components: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
overlay: | |
- local | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Flux CLI | |
uses: fluxcd/flux2/action@main | |
- name: Checkout branch | |
env: | |
BRANCH: update-flux-${{ matrix.overlay }} | |
run: | | |
(git checkout $BRANCH && git pull) || git checkout -b $BRANCH | |
- name: Check for updates | |
id: update | |
run: | | |
flux install --export > ./clusters/overlays/${{ matrix.overlay }}/flux-system/gotk-components.yaml | |
echo "flux_version=$(flux -v)" >> $GITHUB_OUTPUT | |
- name: Commit | |
continue-on-error: true | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git add . | |
git commit -am "[${{ matrix.overlay }}] ${{ steps.update.outputs.flux_version }}" | |
git push -u origin HEAD | |
- name: GitHub Pull Request | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh pr create --fill-first || gh pr status |