Add gha-runner-scale-set-controller canary build (#2405)
This commit is contained in:
parent
261d4371b5
commit
e55708588b
|
|
@ -8,35 +8,47 @@ on:
|
||||||
- master
|
- master
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
- '.github/actions/**'
|
||||||
- '.github/ISSUE_TEMPLATE/**'
|
- '.github/ISSUE_TEMPLATE/**'
|
||||||
- '.github/workflows/validate-chart.yaml'
|
- '.github/workflows/e2e-test-dispatch-workflow.yaml'
|
||||||
- '.github/workflows/publish-chart.yaml'
|
- '.github/workflows/e2e-test-linux-vm.yaml'
|
||||||
- '.github/workflows/publish-arc.yaml'
|
- '.github/workflows/publish-arc.yaml'
|
||||||
- '.github/workflows/runners.yaml'
|
- '.github/workflows/publish-chart.yaml'
|
||||||
- '.github/workflows/validate-entrypoint.yaml'
|
- '.github/workflows/publish-runner-scale-set.yaml'
|
||||||
- '.github/renovate.*'
|
- '.github/workflows/release-runners.yaml'
|
||||||
|
- '.github/workflows/run-codeql.yaml'
|
||||||
|
- '.github/workflows/run-first-interaction.yaml'
|
||||||
|
- '.github/workflows/run-stale.yaml'
|
||||||
|
- '.github/workflows/update-runners.yaml'
|
||||||
|
- '.github/workflows/validate-arc.yaml'
|
||||||
|
- '.github/workflows/validate-chart.yaml'
|
||||||
|
- '.github/workflows/validate-gha-chart.yaml'
|
||||||
|
- '.github/workflows/validate-runners.yaml'
|
||||||
|
- '.github/dependabot.yml'
|
||||||
|
- '.github/RELEASE_NOTE_TEMPLATE.md'
|
||||||
- 'runner/**'
|
- 'runner/**'
|
||||||
- '.gitignore'
|
- '.gitignore'
|
||||||
- 'PROJECT'
|
- 'PROJECT'
|
||||||
- 'LICENSE'
|
- 'LICENSE'
|
||||||
- 'Makefile'
|
- 'Makefile'
|
||||||
|
|
||||||
env:
|
|
||||||
# Safeguard to prevent pushing images to registeries after build
|
|
||||||
PUSH_TO_REGISTRIES: true
|
|
||||||
TARGET_ORG: actions-runner-controller
|
|
||||||
TARGET_REPO: actions-runner-controller
|
|
||||||
|
|
||||||
# https://docs.github.com/en/rest/overview/permissions-required-for-github-apps
|
# https://docs.github.com/en/rest/overview/permissions-required-for-github-apps
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Safeguard to prevent pushing images to registeries after build
|
||||||
|
PUSH_TO_REGISTRIES: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
canary-build:
|
legacy-canary-build:
|
||||||
name: Build and Publish Canary Image
|
name: Build and Publish Legacy Canary Image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
TARGET_ORG: actions-runner-controller
|
||||||
|
TARGET_REPO: actions-runner-controller
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
@ -68,3 +80,42 @@ jobs:
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "**Status:**" >> $GITHUB_STEP_SUMMARY
|
echo "**Status:**" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "[https://github.com/actions-runner-controller/releases/actions/workflows/publish-canary.yaml](https://github.com/actions-runner-controller/releases/actions/workflows/publish-canary.yaml)" >> $GITHUB_STEP_SUMMARY
|
echo "[https://github.com/actions-runner-controller/releases/actions/workflows/publish-canary.yaml](https://github.com/actions-runner-controller/releases/actions/workflows/publish-canary.yaml)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
canary-build:
|
||||||
|
name: Build and Publish gha-runner-scale-set-controller Canary Image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Normalization is needed because upper case characters are not allowed in the repository name
|
||||||
|
# and the short sha is needed for image tagging
|
||||||
|
- name: Resolve parameters
|
||||||
|
id: resolve_parameters
|
||||||
|
run: |
|
||||||
|
echo "INFO: Resolving short sha"
|
||||||
|
echo "short_sha=$(git rev-parse --short ${{ github.ref }})" >> $GITHUB_OUTPUT
|
||||||
|
echo "INFO: Normalizing repository name (lowercase)"
|
||||||
|
echo "repository_owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# Unstable builds - run at your own risk
|
||||||
|
- name: Build and Push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
build-args: VERSION=canary-"${{ github.ref }}"
|
||||||
|
push: ${{ env.PUSH_TO_REGISTRIES }}
|
||||||
|
tags: |
|
||||||
|
ghcr.io/${{ steps.resolve_parameters.outputs.repository_owner }}/gha-runner-scale-set-controller:canary
|
||||||
|
ghcr.io/${{ steps.resolve_parameters.outputs.repository_owner }}/gha-runner-scale-set-controller:canary-"${{ steps.resolve_parameters.outputs.short_sha }}"
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
Loading…
Reference in New Issue