Files
snapcad-studio/.github/workflows/docker.yml
T

54 lines
1.4 KiB
YAML

name: Build and Push Docker Images
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: docker-publish-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
timeout-minutes: 30
permissions:
packages: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=sha,format=short
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: deploy/docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=sketchforge-docker
cache-to: type=gha,mode=max,scope=sketchforge-docker