-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (57 loc) · 2.25 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Docker Container Build
# Adapted from https://docs.docker.com/build/ci/github-actions/
on:
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
backend-prod:
name: Backend Production Container
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v4
with:
# Should match the "build" subsection's settings in docker-compose.yml
context: ./apps/backend
file: ./apps/backend/backend.Dockerfile
# target: production # this has been commented out due to simpler Dockerfile
frontend-prod:
name: Frontend Production Container
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v4
with:
# Should match the "build" subsection's settings in docker-compose.yml
context: ./apps/frontend
file: ./apps/frontend/frontend.Dockerfile
# target: runner # this has been commented out due to simpler Dockerfile
build-args: |
MONGODB_PORT=${{ secrets.MONGODB_PORT }}
MONGODB_USERNAME=${{ secrets.MONGODB_USERNAME }}
MONGODB_PASSWORD=${{ secrets.MONGODB_PASSWORD }}
runner-prod:
name: Runner Production Container
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v4
with:
# Should match the "build" subsection's settings in docker-compose.yml
context: ./apps/runner
file: ./apps/runner/runner.Dockerfile
# target: runner # this has been commented out due to simpler Dockerfile