Update images #225
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 images | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Flux version' | |
required: false | |
schedule: | |
- cron: '00 10 * * 1-5' | |
permissions: | |
contents: read | |
env: | |
ENTERPRISE_REGISTRY: ghcr.io/controlplaneio-fluxcd | |
ENTERPRISE_VARIANTS: alpine;distroless | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_READONLY }} | |
- name: Latest release | |
id: release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
VERSION=$(gh release view --json tagName -q '.tagName') | |
if [ "${{ github.event.inputs.version }}" != "" ]; then | |
VERSION="${{ github.event.inputs.version }}" | |
fi | |
echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Setup Flux | |
uses: fluxcd/flux2/action@5350425cdcd5fa015337e09fa502153c0275bd4b #v2.4.0 | |
with: | |
version: ${{ steps.release.outputs.version }} | |
- name: Enterprise images | |
shell: bash | |
run: | | |
for variant in ${ENTERPRISE_VARIANTS//;/$'\n'} | |
do | |
DISTRIBUTION="enterprise" \ | |
REGISTRY="${ENTERPRISE_REGISTRY}" \ | |
VARIANT="${variant}" \ | |
VERSION="${{ steps.release.outputs.version }}" \ | |
.github/workflows/update-images.sh | |
done | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: | | |
Update images for Flux ${{ steps.release.outputs.version }} | |
committer: GitHub <[email protected]> | |
signoff: true | |
branch: update-images-${{ steps.release.outputs.version }} | |
title: Update images for Flux ${{ steps.release.outputs.version }} | |
body: | | |
Update images with digests for Flux ${{ steps.release.outputs.version }} | |
labels: | | |
area/images |