Skip to content

Commit 1bc0797

Browse files
committed
Build and push docker images to GHCR
1 parent 6d421dd commit 1bc0797

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/build-deliver.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# docker continuous delivery
2+
# build docker images and push to configured repo, with tags to match branches and git tags
3+
---
4+
name: Build & Deliver
5+
on: [push]
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
# create a separate job for frontend and backend builds
12+
include:
13+
- leaf_service: api
14+
build_path: ./src/server
15+
16+
- leaf_service: frontend
17+
build_path: ./src/ui-client
18+
steps:
19+
- name: Checkout git commit
20+
uses: actions/checkout@main
21+
22+
- name: Publish to GitHub Container Registry
23+
# TODO: pin to hash
24+
uses: elgohr/Publish-Docker-Github-Action@main
25+
with:
26+
# build a docker image for each service
27+
name: ${{ github.repository }}-${{ matrix.leaf_service }}
28+
context: ${{ matrix.build_path }}
29+
30+
registry: ghcr.io
31+
# GitHub actor
32+
username: ${{ github.actor }}
33+
34+
# GitHub access token
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
# create docker image tags to match git tags
38+
tag_names: true

0 commit comments

Comments
 (0)