46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
name: Docker
|
|
|
|
on:
|
|
push:
|
|
tags: ["*.*.*"]
|
|
|
|
env:
|
|
# github.repository as <account>/<repo>
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Setup QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Setup Docker buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Log into registry ghcr.io
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: ghcr.io/${{ env.IMAGE_NAME }}
|
|
|
|
- name: Build and push Docker image
|
|
id: build-and-push
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
labels: ${{ steps.meta.outputs.labels }}
|