feat(workflow): update runner to rename bear to ci-base #2
Workflow file for this run
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 & push multi-arch image | ||
on: | ||
workflow_call: | ||
secrets: | ||
build-secrets: | ||
description: "Build secrets" | ||
required: false | ||
inputs: | ||
service: | ||
description: "Name to tag the image" | ||
type: string | ||
required: true | ||
version: | ||
description: "Version to tag the image" | ||
type: string | ||
required: true | ||
build-args: | ||
description: "Build args" | ||
type: "string" | ||
required: false | ||
context: | ||
description: "Build context" | ||
type: string | ||
required: false | ||
default: "." | ||
labels: | ||
description: "Image labels" | ||
type: string | ||
required: false | ||
jobs: | ||
build: | ||
name: Build and push image | ||
runs-on: [ self-hosted, ci-basej | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker context for Buildx | ||
run: docker context create builders | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
endpoint: builders | ||
- name: Build and push images | ||
uses: docker/build-push-action@v5 | ||
with: | ||
build-args: ${{ inputs.build-args }} | ||
context: ${{ inputs.context }} | ||
labels: ${{ inputs.labels }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ vars.IMAGE_REGISTRY }}/${{ inputs.service }}:${{ inputs.version }} | ||
secrets: ${{ secrets.build-secrets }} | ||
- name: Push latest image | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
uses: docker/build-push-action@v5 | ||
with: | ||
build-args: ${{ inputs.build-args }} | ||
context: ${{ inputs.context }} | ||
labels: ${{ inputs.labels }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
secrets: ${{ secrets.build-secrets }} | ||
tags: ${{ vars.IMAGE_REGISTRY }}/${{ inputs.service }}:latest |