feat: cleanup workflows #1586
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 Docker image | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@5964de0df58d5ad28b04d8fe2e6b80ad47105b91 # v3.5.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | |
with: | |
buildkitd-config: .github/buildkitd.toml | |
- name: Retrieve author data | |
id: author | |
run: | | |
AUTHOR=$(curl -sSL ${{ github.event.repository.owner.url }} | jq -r '.name') | |
echo "AUTHOR=$AUTHOR" >> $GITHUB_ENV | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
labels: | | |
org.opencontainers.image.authors=${{ env.AUTHOR }} | |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
org.opencontainers.image.created=${{ steps.meta.outputs.created }} | |
- name: Build Docker image | |
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: false | |
load: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
VERSION=${{ github.head_ref || github.ref_name }} | |
COMMIT=${{ github.sha }} | |
- name: Inspect Docker image | |
run: docker image inspect ${{ steps.meta.outputs.tags }} |