Files
auricom-home-cluster/.github/workflows/schedule-flux-update.yaml
2022-01-23 16:22:02 +01:00

45 lines
1.6 KiB
YAML

---
name: Schedule - Flux Update
on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
- cron: "0 */4 * * *"
jobs:
flux-update:
name: Flux Update
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate Token
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: "${{ secrets.BOT_APP_ID }}"
private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Install Flux
uses: fluxcd/flux2/action@main
- name: Flux Update
id: update
run: |
UGLY_VERSION="$(flux -v)"
VERSION="v${UGLY_VERSION#*flux version }"
flux install --version="${VERSION}" \
--components-extra=image-reflector-controller,image-automation-controller \
--network-policy=false \
--export > ./cluster/base/flux-system/gotk-components.yaml
echo "::set-output name=flux_version::$VERSION"
- name: Create pull request
uses: peter-evans/create-pull-request@v3
with:
token: "${{ steps.generate-token.outputs.token }}"
branch: "ci/flux-update-${{ steps.update.outputs.flux_version }}"
delete-branch: true
title: "chore(ci): update flux components to ${{ steps.update.outputs.flux_version }}"
signoff: true
commit-message: "chore(ci): update flux components to ${{ steps.update.outputs.flux_version }}"
body: |
Release notes: https://github.com/fluxcd/flux2/releases/tag/${{ steps.update.outputs.flux_version }}