From 65aa9d66d3a2ae5c036eaa0a0b52e82ed64c051c Mon Sep 17 00:00:00 2001 From: Xevion Date: Thu, 11 Dec 2025 17:28:43 -0600 Subject: [PATCH] ci: add Docker build and publish workflow Add GitHub Actions workflow job to build and publish Docker images to GitHub Container Registry. Images are pushed on master branch commits and tags, with appropriate tagging strategy including semver, branch refs, and SHA. --- .github/workflows/quality.yaml | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index d99c085..83584b7 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -90,3 +90,45 @@ jobs: - name: Build run: pnpm build + + docker: + name: Docker + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max