-
Notifications
You must be signed in to change notification settings - Fork 84
43 lines (40 loc) · 1.48 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- main
env:
COMPOSE_INTERACTIVE_NO_CLI: 1
jobs:
test:
runs-on: ubuntu-latest
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_GIT_BRANCH: ${{ github.ref }}
steps:
- uses: actions/checkout@v1
- name: Fetch latest docker-compose
run: sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- name: Build containers
run: docker-compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel
- name: Test
run: docker-compose -f ./docker-compose.yml -f ./docker-compose.ci.yml run -T app poetry run make test
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build app image
run: docker build -t ghcr.io/emfcamp/website:latest -f ./Dockerfile.prod .
- name: Publish app image
run: docker push ghcr.io/emfcamp/website:latest
- name: Build static image
run: docker build -t ghcr.io/emfcamp/website-static:latest -f ./docker/static/Dockerfile ./docker/static/
- name: Publish static image
run: docker push ghcr.io/emfcamp/website-static:latest