From c86fd9141514359d8a55a774bffe026f6045d62f Mon Sep 17 00:00:00 2001 From: Ivan Cvitkovic Date: Thu, 26 Sep 2024 11:37:16 -0700 Subject: [PATCH 1/2] Build and push docker images to GHCR --- .github/workflows/build-deliver.yaml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/build-deliver.yaml diff --git a/.github/workflows/build-deliver.yaml b/.github/workflows/build-deliver.yaml new file mode 100644 index 00000000..812cb169 --- /dev/null +++ b/.github/workflows/build-deliver.yaml @@ -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 From db18dcd71fd9e0ce87b50f77d52eaf971a0abd34 Mon Sep 17 00:00:00 2001 From: Ivan Cvitkovic Date: Thu, 26 Sep 2024 12:41:54 -0700 Subject: [PATCH 2/2] Add GHCR as docker image repo --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 94e1e32e..a1169ee4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,7 @@ services: - internal coreapi: + image: ghcr.io/uwcirg/leaf-api:${LEAF_API_IMAGE_TAG:-latest} build: context: ./src/server depends_on: @@ -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: