From a6b6eca4d999f69412e2d348aeda86387845b3ab Mon Sep 17 00:00:00 2001 From: Florian Gareis Date: Sun, 2 Jun 2024 21:52:49 +0000 Subject: [PATCH 1/2] Add github docker image build workflow --- .github/workflows/build-images.yaml | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build-images.yaml diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml new file mode 100644 index 00000000..9d513f22 --- /dev/null +++ b/.github/workflows/build-images.yaml @@ -0,0 +1,50 @@ +name: Publish Docker Images + +on: + push: + branches: + - 'main' + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + strategy: + matrix: + service: + - name: frontend + context: ./worklenz-frontend + container_name: worklenz_frontend + - name: backend + context: ./worklenz-backend + container_name: worklenz_backend + steps: + - name: Checkout the codebase + uses: actions/checkout@v4 + + - name: Login to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ matrix.service.container_name }} + flavor: | + latest=true + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: ${{ matrix.service.context }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 1b669f76b8db293bd459aadf1a5a7ac519fa9444 Mon Sep 17 00:00:00 2001 From: Florian Gareis Date: Sun, 2 Jun 2024 22:04:47 +0000 Subject: [PATCH 2/2] Add images to compose file --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index a944cc78..38311543 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,6 @@ services: frontend: + image: ghcr.io/worklenz/worklenz-frontend build: context: ./worklenz-frontend dockerfile: Dockerfile @@ -11,6 +12,7 @@ services: condition: service_started backend: + image: ghcr.io/worklenz/worklenz-frontend build: context: ./worklenz-backend dockerfile: Dockerfile