-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1.15 KB
/
schedule.yaml
File metadata and controls
37 lines (31 loc) · 1.15 KB
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
name: Schedule build
on:
schedule:
- cron: "5 0 * * *"
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
target:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Check latest kwok
run: |
echo "KWOK_VERSION=$(gh api /repos/kubernetes-sigs/kwok/releases/latest | jq -r .tag_name)" >> $GITHUB_ENV
- name: Check latest k8s
env:
REPO: "${{ github.repository }}"
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
while IFS= read -r line; do
if ! skopeo inspect --raw docker://ghcr.io/kwok-ci/cluster:${KWOK_VERSION}-k8s.${line} >/dev/null 2>&1; then
echo "Trigger build ${KWOK_VERSION}-k8s.${line}"
gh -R "${REPO}" workflow run build.yaml -F tag=${line} -F kwok-tag=${KWOK_VERSION}
# sleep 30 seconds to avoid rate limit
sleep 30
else
echo "Skip ${KWOK_VERSION}-k8s.${line}"
fi
done < <(gh api '/repos/kubernetes/kubernetes/releases?per_page=100&page=1' --jq '.[] | select( .tag_name | contains("-") | not ) | .tag_name')