-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (82 loc) · 2.4 KB
/
build.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: build
on:
push:
branches:
- master
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
pull_request:
schedule:
- cron: "30 2 * * *"
jobs:
test:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
tox-env: [py38, linters, packaging, migrations]
services:
postgres:
image: postgres:11
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_USER: rola
POSTGRES_DB: rola
ports:
- 5432/tcp
# Needed because the postgres container does not provide a healthcheck.
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:5
ports:
- 6379/tcp
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Tox
run: python -m pip install --user tox
# - name: Run Tox
# run: python -m tox -e ${{ matrix.tox-env }} --skip-missing-interpreters false
# env:
# # Get randomly assigned published ports.
# ROLA_POSTGRESQL_PORT: ${{ job.services.postgres.ports[5432] }}
# ROLA_REDIS_PORT: ${{ job.services.redis.ports[6379] }}
# - name: Upload coverage to Codecov
# if: matrix.tox-env == 'py38'
# uses: codecov/codecov-action@v1
# with:
# token: ${{ secrets.codecov_token }}
# file: .coverage
build:
runs-on: ubuntu-18.04
needs: test
strategy:
matrix:
image-name: [backend, frontend, nginx]
include:
- image-name: backend
workdir: "."
dockerfile: Dockerfile
- image-name: frontend
workdir: frontend
dockerfile: Dockerfile
- image-name: nginx
workdir: docker/nginx
dockerfile: Dockerfile
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Publish Docker Image to GPR
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: dblenkus/rola/${{ matrix.image-name }}
username: dblenkus
password: ${{ secrets.GITHUB_TOKEN }}
workdir: ${{ matrix.workdir }}
dockerfile: ${{ matrix.dockerfile }}
tag_names: true
registry: docker.pkg.github.com