-
Notifications
You must be signed in to change notification settings - Fork 5
125 lines (109 loc) · 4.15 KB
/
kubernetes_update.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
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