Update image deps #240
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 image deps | |
on: | |
schedule: | |
- cron: '0 4 * * *' | |
workflow_dispatch: | |
inputs: | |
k0s_version: | |
description: 'K0s version for discovering image versions' | |
required: false | |
openebs_version: | |
description: 'OpenEBS version for discovering image versions' | |
required: false | |
velero_version: | |
description: 'Velero version for discovering image versions' | |
required: false | |
velero_aws_plugin_version: | |
description: 'Velero AWS plugin version for discovering image versions' | |
required: false | |
kubectl_version: | |
description: 'Kubectl version for discovering image versions' | |
required: false | |
seaweedfs_version: | |
description: 'SeaweedFS version for discovering image versions' | |
required: false | |
jobs: | |
compile-buildtools: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache-dependency-path: "**/*.sum" | |
- name: Compile buildtools | |
run: | | |
make buildtools | |
- name: Upload buildtools artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: buildtools | |
path: output/bin/buildtools | |
update-addon-images: | |
runs-on: ubuntu-20.04 | |
needs: [compile-buildtools] | |
strategy: | |
fail-fast: false | |
matrix: | |
addon: | |
- k0s | |
- openebs | |
- velero | |
- seaweedfs | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download buildtools artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: buildtools | |
path: output/bin | |
- name: Update ${{ matrix.addon }} images | |
env: | |
IMAGES_REGISTRY_SERVER: index.docker.io | |
IMAGES_REGISTRY_USER: ${{ secrets.DOCKERHUB_USER }} | |
IMAGES_REGISTRY_PASS: ${{ secrets.DOCKERHUB_PASSWORD }} | |
INPUT_K0S_VERSION: ${{ github.event.inputs.k0s_version }} | |
INPUT_OPENEBS_VERSION: ${{ github.event.inputs.openebs_version }} | |
INPUT_VELERO_VERSION: ${{ github.event.inputs.velero_version }} | |
INPUT_VELERO_AWS_PLUGIN_VERSION: ${{ github.event.inputs.velero_aws_plugin_version }} | |
INPUT_KUBECTL_VERSION: ${{ github.event.inputs.kubectl_version }} | |
INPUT_SEAWEEDFS_VERSION: ${{ github.event.inputs.seaweedfs_version }} | |
ARCHS: "amd64,arm64" | |
run: | | |
chmod +x ./output/bin/buildtools | |
./output/bin/buildtools update images ${{ matrix.addon }} | |
- name: Create Pull Request # creates a PR if there are differences | |
uses: peter-evans/create-pull-request@v7 | |
id: cpr | |
with: | |
token: ${{ secrets.GH_PAT }} | |
commit-message: 'Update image versions' | |
title: "chore: update ${{ matrix.addon }} images" | |
branch: automation/${{ matrix.addon }}-image-dependencies | |
delete-branch: true | |
labels: | | |
automated-pr | |
images | |
type::security | |
draft: false | |
base: ${{ github.ref_name }} | |
body: "Automated changes by the [image-deps-updater](https://github.com/replicatedhq/embedded-cluster/blob/main/.github/workflows/image-deps-updater.yaml) GitHub action" | |
- name: Check outputs | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |