From a847a86371090ce7e1dcfd9763f7cddb20c47a96 Mon Sep 17 00:00:00 2001 From: Kaarel Date: Tue, 20 Jan 2026 20:58:52 +0000 Subject: [PATCH 1/2] =?UTF-8?q?pls=20docker=20image=20=F0=9F=99=8F?= =?UTF-8?q?=F0=9F=8F=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-publish.yml | 65 ++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..9f3dd50 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,65 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - master + tags: + - 'v*' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v6.0.1 + + - name: Get version from package.json + id: package-version + run: | + VERSION=$(node -p "require('./package.json').version") + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.12.0 + + - name: Log in to Container Registry + uses: docker/login-action@v3.6.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.10.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + # Set latest tag for master branch + type=raw,value=latest,enable={{is_default_branch}} + # Use version from package.json + type=raw,value=${{ steps.package-version.outputs.version }} + # Use short SHA + type=sha,prefix= + # Use git tag if present + type=ref,event=tag + + - name: Build and push Docker image + uses: docker/build-push-action@v6.18.0 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/amd64,linux/arm64 From 4d34f1fb78fddbfa4cab85a86926334bdd5ae013 Mon Sep 17 00:00:00 2001 From: Kaarel Date: Tue, 20 Jan 2026 21:02:00 +0000 Subject: [PATCH 2/2] add DATABASE_URL build argument for Docker image to fix stupid prisma --- .github/workflows/docker-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 9f3dd50..06b88ec 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -63,3 +63,5 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 + build-args: | + DATABASE_URL=postgresql://user:password@localhost:5432/db