Release All Base Docker images #30
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: Release All Base Docker images | |
permissions: read-all | |
on: | |
workflow_dispatch: | |
inputs: | |
commit: | |
description: "Commit sha to build from" | |
required: true | |
default: main | |
bump: | |
type: choice | |
description: "Bump type [major, minor, patch]" | |
required: true | |
default: patch | |
options: | |
- major | |
- minor | |
- patch | |
latest: | |
type: boolean | |
description: "Also update latest tags" | |
required: true | |
default: false | |
jobs: | |
build-push-multi-arch-images: | |
runs-on: ubuntu-latest-16-cores | |
strategy: | |
matrix: | |
# note this arch represents a single matrix option, see quotes | |
arch: ["linux/amd64,linux/arm64"] | |
image: [base-server, base-builder, base-admin-tools, base-ci-builder] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.inputs.commit }} | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: "src/go.mod" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PAT }} | |
- name: Bump version | |
id: bump | |
env: | |
REPO: ${{ matrix.image }} | |
BUMP: ${{ github.event.inputs.bump }} | |
run: | | |
tag=$(cd src; go run image_tags/main.go -org temporalio -repo "$REPO" bump "$BUMP") | |
echo "tag=$tag" >> $GITHUB_OUTPUT | |
- name: Metatags for the image | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: temporalio/${{ matrix.image }} | |
tags: | | |
type=raw,value=${{ steps.bump.outputs.tag }} | |
type=raw,value=latest,enable=${{ github.event.inputs.latest }} | |
- name: Build and Push the image | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
pull: true | |
file: docker/base-images/${{ matrix.image }}.Dockerfile | |
platforms: ${{ matrix.arch }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |