Skip to content

Commit

Permalink
Merge pull request #29 from TheZoker/add-workflow
Browse files Browse the repository at this point in the history
Add workflow to pre-build docker images
  • Loading branch information
chamikaJ authored Jun 4, 2024
2 parents ff80672 + 1b669f7 commit 5cce1f2
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
frontend:
image: ghcr.io/worklenz/worklenz-frontend
build:
context: ./worklenz-frontend
dockerfile: Dockerfile
Expand All @@ -11,6 +12,7 @@ services:
condition: service_started

backend:
image: ghcr.io/worklenz/worklenz-frontend
build:
context: ./worklenz-backend
dockerfile: Dockerfile
Expand Down

0 comments on commit 5cce1f2

Please sign in to comment.