Schedule build #220
This file contains hidden or 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: 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') |