Build scilus/actions-runner image #92
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: Build scilus/actions-runner image | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 7 * * *" # Runs at 02:00-EST (7:00-UTC) every day | |
jobs: | |
compute-dependencies-versions: | |
runs-on: ubuntu-latest | |
container: | |
image: scilus/actions-runner:latest | |
outputs: | |
runner_current_version: ${{ steps.github-runner.outputs.current_version }} | |
runner_latest_version: ${{ steps.github-runner.outputs.latest_version }} | |
steps: | |
- uses: ksivamuthu/actions-setup-gh-cli@v3 | |
# From : https://github.com/actions/actions-runner-controller/blob/0bfa57ac504dfc818128f7185fc82830cbdb83f1/.github/workflows/arc-update-runners-scheduled.yaml#L14 | |
- name: actions-runner version | |
id: github-runner | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
CURRENT_VERSION=$(echo -n $(cat /VERSION | grep 'runner =>' | cut -d '>' -f2 | tr -d '\n' | tr -d ' ')) | |
LATEST_VERSION=$(gh release list --exclude-drafts --exclude-pre-releases --limit 1 -R actions/runner | grep -oP '(?<=v)[0-9.]+' | head -1) | |
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT | |
echo "latest_version=$LATEST_VERSION" >> $GITHUB_OUTPUT | |
build-runner-image: | |
needs: [compute-dependencies-versions] | |
if: ${{ needs.compute-dependencies-versions.outputs.runner_current_version != needs.compute-dependencies-versions.outputs.runner_latest_version }} | |
uses: ./.github/workflows/docker-builder.yml | |
with: | |
target: actions-runner | |
update-latest: true | |
disable-builddate-tag: true | |
actions-runner-version: ${{ needs.compute-dependencies-versions.outputs.runner_latest_version }} | |
secrets: inherit |