Build and Push #1
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 and Push | |
on: | |
push: | |
tags: | |
- v4.* | |
workflow_dispatch: | |
jobs: | |
build-push: | |
name: Build/Push image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
packages: write | |
steps: | |
- | |
name: Checkout repository | |
uses: actions/checkout@v4 | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
context: git | |
images: | | |
name=ghcr.io/${{ github.repository_owner }}/quartz,enable=true | |
# name=docker.io/${{ github.repository_owner }}/quartz,enable=false | |
labels: | | |
org.opencontainers.image.title=quartz | |
org.opencontainers.image.vendor=Quartz Community | |
org.opencontainers.image.description=A container image for Quartz | |
org.opencontainers.image.licenses=CC0 | |
tags: | | |
type=semver,pattern={{ version }} | |
type=semver,pattern={{ major }}.{{ minor }} | |
type=ref,event=branch | |
type=ref,event=tag | |
type=ref,event=pr | |
{{ sha }} | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# - | |
# name: Login to Docker Hub | |
# uses: docker/login-action@v3 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Login to GitHub Packages Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
platforms: linux/amd64 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |