kingfisher/.github/workflows/release-docker.yml

36 lines
983 B
YAML

# .github/workflows/release-docker.yml
name: Publish Docker image
on:
release:
types: [published]
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare release tag
id: tag
run: |
TAG=${RELEASE_TAG#v}
echo "tag=$TAG" >>"$GITHUB_OUTPUT"
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
- uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/mongodb/kingfisher:latest
ghcr.io/mongodb/kingfisher:${{ steps.tag.outputs.tag }}