mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-11 03:57:01 +00:00
As a part of #1298, I'm going to use Go fuzzing which is availabls since Go 1.18. Co-authored-by: Callum Tait <15716903+toast-gear@users.noreply.github.com>
70 lines
2.4 KiB
YAML
70 lines
2.4 KiB
YAML
name: Publish Controller Image
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
name: Release
|
|
env:
|
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USER }}
|
|
steps:
|
|
- name: Set outputs
|
|
id: vars
|
|
run: echo ::set-output name=sha_short::${GITHUB_SHA::7}
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
|
|
|
- uses: actions/setup-go@193b404f8a1d1dccaf6ed9bf03cdb68d2d02020f
|
|
with:
|
|
go-version: '1.18.2'
|
|
|
|
- name: Install tools
|
|
run: |
|
|
curl -L -O https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.2.0/kubebuilder_2.2.0_linux_amd64.tar.gz
|
|
tar zxvf kubebuilder_2.2.0_linux_amd64.tar.gz
|
|
sudo mv kubebuilder_2.2.0_linux_amd64 /usr/local/kubebuilder
|
|
curl -s https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh | bash
|
|
sudo mv kustomize /usr/local/bin
|
|
curl -L -O https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz
|
|
tar zxvf ghr_v0.13.0_linux_amd64.tar.gz
|
|
sudo mv ghr_v0.13.0_linux_amd64/ghr /usr/local/bin
|
|
|
|
- name: Set version
|
|
run: echo "VERSION=$(cat ${GITHUB_EVENT_PATH} | jq -r '.release.tag_name')" >> $GITHUB_ENV
|
|
|
|
- name: Upload artifacts
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: make github-release
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@0522dcd2bf084920c411162fde334a308be75015
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@91cb32d715c128e5f0ede915cd7e196ab7799b83
|
|
with:
|
|
version: latest
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@d398f07826957cd0a18ea1b059cf1207835e60bc
|
|
with:
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
|
|
|
- name: Build and Push
|
|
uses: docker/build-push-action@c5e6528d5ddefc82f682165021e05edf58044bce
|
|
with:
|
|
file: Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
${{ env.DOCKERHUB_USERNAME }}/actions-runner-controller:latest
|
|
${{ env.DOCKERHUB_USERNAME }}/actions-runner-controller:${{ env.VERSION }}
|
|
${{ env.DOCKERHUB_USERNAME }}/actions-runner-controller:${{ env.VERSION }}-${{ steps.vars.outputs.sha_short }}
|
|
|