Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: refactoring publishing flow

Andrej5471b88ee244
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1d9bf7318..2e403d259 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,33 +1,55 @@
-name: Docker Build, Changelog, and Release
+name: Build & publish images to GHCR
on:
push:
branches:
- main
+env:
+ REGISTRY: ghcr.io # GitHub Container Registry
+ IMAGE_NAME: ${{ github.repository }}
+
jobs:
- build:
+ build-and-push-image:
runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - dockerfile: ./apps/web/Dockerfile
+ image: ghcr.io/${{ github.repository_owner }}/web
+ - dockerfile: ./apps/api/Dockerfile
+ image: ghcr.io/${{ github.repository_owner }}/api
+ permissions:
+ contents: read
+ packages: write
+
steps:
- - name: Checkout code
+ - name: Checkout repository
uses: actions/checkout@v3
- - name: Build and push web Docker image
- uses: docker/build-push-action@v4
+ - name: Log in to GitHub Container Registry
+ uses: docker/login-action@v2
with:
- context: .
- dockerfile: ./apps/web/Dockerfile
- push: true
+ registry: ${{ env.REGISTRY }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GH_PACKAGE_TOKEN }}
+
+ - name: Extract metadata (tags, labels) for Docker
+ id: meta
+ uses: docker/metadata-action@v4
+ with:
+ images: ${{ matrix.image }}
tags: |
- ghcr.io/${{ github.repository_owner }}/web:latest
- ghcr.io/${{ github.repository_owner }}/web:${{ github.sha }}
+ type=ref,event=branch
+ type=ref,event=tag
+ type=sha
- - name: Build and push api Docker image
+ - name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
- dockerfile: ./apps/api/Dockerfile
+ file: ${{ matrix.dockerfile }}
push: true
- tags: |
- ghcr.io/${{ github.repository_owner }}/api:latest
- ghcr.io/${{ github.repository_owner }}/api:${{ github.sha }}
\ No newline at end of file
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
\ No newline at end of file