ci: add automated package publish workflow

This commit is contained in:
germondai
2026-06-23 14:15:00 +02:00
parent 24a6fa6277
commit dd32a636d6
+47
View File
@@ -0,0 +1,47 @@
name: Publish
on:
push:
branches: [main]
tags: ['v*']
env:
IMAGE: ghcr.io/${{ github.repository_owner }}/trawl
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.IMAGE }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=sha,prefix=sha-
- uses: docker/build-push-action@v6
with:
context: .
file: apps/api/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max