10
10
11
11
jobs :
12
12
build :
13
- name : DockerHub Cache
13
+ name : Docker Hub Cache
14
14
runs-on : ubuntu-latest
15
15
steps :
16
16
- name : Checkout master
51
51
run : docker push $CACHE_IMAGE:build
52
52
- name : Push stage image to Docker Hub
53
53
run : docker push $CACHE_IMAGE:stage
54
+
55
+ build-gpr :
56
+ if : false # https://github.community/t/docker-pull-from-public-github-package-registry-fail-with-no-basic-auth-credentials-error/16358
57
+ name : GitHub Package Registry Cache
58
+ runs-on : ubuntu-latest
59
+ steps :
60
+ - name : Checkout master
61
+ uses : actions/checkout@v1
62
+ - name : Log in to GitHub Package Registry
63
+ run : echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin
64
+ - name : Build static image from Dockerfile
65
+ run : |
66
+ docker pull $GPR_CACHE_IMAGE:static || true
67
+ docker build \
68
+ --target static \
69
+ --cache-from $GPR_CACHE_IMAGE:static \
70
+ --tag $GPR_CACHE_IMAGE:static \
71
+ --file ./Dockerfile \
72
+ # can't use BuildKit for GPR
73
+ "."
74
+ - name : Build build image from Dockerfile
75
+ run : |
76
+ docker pull $GPR_CACHE_IMAGE:build || true
77
+ docker build \
78
+ --target build \
79
+ --cache-from $GPR_CACHE_IMAGE:static \
80
+ --cache-from $GPR_CACHE_IMAGE:build \
81
+ --tag $GPR_CACHE_IMAGE:build \
82
+ --file ./Dockerfile \
83
+ # can't use BuildKit for GPR
84
+ "."
85
+ - name : Build stage image from Dockerfile
86
+ run : |
87
+ docker pull $GPR_CACHE_IMAGE:stage || true
88
+ docker build \
89
+ --cache-from $GPR_CACHE_IMAGE:build \
90
+ --cache-from $GPR_CACHE_IMAGE:stage \
91
+ --tag $GPR_CACHE_IMAGE:stage \
92
+ --file ./Dockerfile \
93
+ --build-arg BUILDKIT_INLINE_CACHE=1 \
94
+ # can't use BuildKit for GPR
95
+ "."
96
+ - name : Push static image to package registry
97
+ run : docker push $GPR_CACHE_IMAGE:static
98
+ - name : Push build image to package registry
99
+ run : docker push $GPR_CACHE_IMAGE:build
100
+ - name : Push stage image to package registry
101
+ run : docker push $GPR_CACHE_IMAGE:stage
54
102
55
103
test :
56
104
needs : build
99
147
python -m coverage run -m pytest --strict --postgresql-host postgres
100
148
python -m coverage html
101
149
python -m coverage report -m --fail-under 100
102
- # TODO: use bin/tests
103
150
env :
104
151
# The hostname used to communicate with the PostgreSQL service container
105
152
POSTGRES_HOST : postgres
@@ -227,4 +274,4 @@ jobs:
227
274
npm install -D babel
228
275
229
276
- name : Static Pipeline
230
- run : bin/static_pipeline || bin/static_pipeline || bin/static_pipeline
277
+ run : bin/static_pipeline
0 commit comments