Skip to content

Commit

Permalink
Merge pull request #7 from uwcirg/fixup/continuous-delivery
Browse files Browse the repository at this point in the history
Continuous Delivery
  • Loading branch information
ivan-c authored Sep 27, 2024
2 parents 18954f7 + db18dcd commit 13688c4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build-deliver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# docker continuous delivery
# build docker images and push to configured repo, with tags to match branches and git tags
---
name: Build & Deliver
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# create a separate job for frontend and backend builds
include:
- leaf_service: api
build_path: ./src/server

- leaf_service: frontend
build_path: ./src/ui-client
steps:
- name: Checkout git commit
uses: actions/checkout@main

- name: Publish to GitHub Container Registry
# TODO: pin to hash
uses: elgohr/Publish-Docker-Github-Action@main
with:
# build a docker image for each service
name: ${{ github.repository }}-${{ matrix.leaf_service }}
context: ${{ matrix.build_path }}

registry: ghcr.io
# GitHub actor
username: ${{ github.actor }}

# GitHub access token
password: ${{ secrets.GITHUB_TOKEN }}

# create docker image tags to match git tags
tag_names: true
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- internal

coreapi:
image: ghcr.io/uwcirg/leaf-api:${LEAF_API_IMAGE_TAG:-latest}
build:
context: ./src/server
depends_on:
Expand All @@ -38,6 +39,7 @@ services:
- internal

node:
image: ghcr.io/uwcirg/leaf-frontend:${LEAF_FRONTEND_IMAGE_TAG:-latest}
build:
context: ./src/ui-client
depends_on:
Expand Down

0 comments on commit 13688c4

Please sign in to comment.