Update Kubernetes versions #515
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 Kubernetes versions | |
on: | |
# Allow manual executions | |
workflow_dispatch: | |
# Run nightly | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
propose_patch_versions: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install script dependencies | |
run: pip install -r ./requirements.txt | |
- name: Check for Kubernetes updates | |
id: k8s-update | |
run: ./bin/k8s-update | |
- name: Generate app token for PR | |
uses: azimuth-cloud/github-actions/generate-app-token@master | |
id: generate-app-token | |
with: | |
repository: ${{ github.repository }} | |
app-id: ${{ secrets.AUTOMATION_APP_ID }} | |
app-private-key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }} | |
- name: Propose changes via PR if required | |
if: ${{ steps.k8s-update.outputs.pr }} | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ steps.generate-app-token.outputs.token }} | |
commit-message: ${{ fromJson(steps.k8s-update.outputs.pr).title }} | |
branch: update/kubernetes-patch | |
delete-branch: true | |
title: ${{ fromJson(steps.k8s-update.outputs.pr).title }} | |
body: ${{ fromJson(steps.k8s-update.outputs.pr).body }} | |
labels: | | |
automation | |
kubernetes-version | |
propose_next_version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install script dependencies | |
run: pip install -r ./requirements.txt | |
- name: Check for next Kubernetes version | |
id: k8s-next | |
run: ./bin/k8s-next | |
- name: Generate app token for PR | |
uses: azimuth-cloud/github-actions/generate-app-token@master | |
id: generate-app-token | |
with: | |
repository: ${{ github.repository }} | |
app-id: ${{ secrets.AUTOMATION_APP_ID }} | |
app-private-key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }} | |
- name: Propose changes via PR if required | |
if: ${{ steps.k8s-next.outputs.pr }} | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ steps.generate-app-token.outputs.token }} | |
commit-message: ${{ fromJson(steps.k8s-next.outputs.pr).title }} | |
branch: update/kubernetes-next | |
delete-branch: true | |
title: ${{ fromJson(steps.k8s-next.outputs.pr).title }} | |
body: ${{ fromJson(steps.k8s-next.outputs.pr).body }} | |
labels: | | |
automation | |
kubernetes-version | |
propose_image_builder: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Check for most recent image-builder release | |
id: next | |
uses: azimuth-cloud/github-actions/github-latest-release@master | |
with: | |
repository: kubernetes-sigs/image-builder | |
- name: Fetch tags for image-builder submodule | |
run: git fetch --tags | |
working-directory: ./vendor/image-builder | |
- name: Update image-builder submodule | |
run: git checkout ${{ steps.next.outputs.version }} | |
working-directory: ./vendor/image-builder | |
- name: Generate app token for PR | |
uses: azimuth-cloud/github-actions/generate-app-token@master | |
id: generate-app-token | |
with: | |
repository: ${{ github.repository }} | |
app-id: ${{ secrets.AUTOMATION_APP_ID }} | |
app-private-key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }} | |
- name: Propose changes via PR if required | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ steps.generate-app-token.outputs.token }} | |
commit-message: >- | |
Update image-builder submodule to ${{ steps.next.outputs.version }} | |
branch: update/kubernetes-image-builder | |
delete-branch: true | |
title: >- | |
Update image-builder submodule to ${{ steps.next.outputs.version }} | |
body: | | |
This PR was created automatically to update the Kubernetes image-builder | |
submodule to ${{ steps.next.outputs.version }}. | |
labels: | | |
automation | |
dependency-update |