Skip to content

Commit 59664bd

Browse files
committed
github package registry
1 parent fe026f2 commit 59664bd

File tree

3 files changed

+50
-12
lines changed

3 files changed

+50
-12
lines changed

.github/actions/docker/action.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010

1111
jobs:
1212
build:
13-
name: DockerHub Cache
13+
name: Docker Hub Cache
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout master
@@ -51,6 +51,54 @@ jobs:
5151
run: docker push $CACHE_IMAGE:build
5252
- name: Push stage image to Docker Hub
5353
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
54102

55103
test:
56104
needs: build
@@ -99,7 +147,6 @@ jobs:
99147
python -m coverage run -m pytest --strict --postgresql-host postgres
100148
python -m coverage html
101149
python -m coverage report -m --fail-under 100
102-
# TODO: use bin/tests
103150
env:
104151
# The hostname used to communicate with the PostgreSQL service container
105152
POSTGRES_HOST: postgres
@@ -227,4 +274,4 @@ jobs:
227274
npm install -D babel
228275
229276
- name: Static Pipeline
230-
run: bin/static_pipeline || bin/static_pipeline || bin/static_pipeline
277+
run: bin/static_pipeline

docker-compose.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ services:
4242
web:
4343
build:
4444
context: .
45-
cache_from:
46-
- fmrcampos/docker-ci-cache:static
47-
- fmrcampos/docker-ci-cache:build
48-
- fmrcampos/docker-ci-cache:stage
4945
args:
5046
DEVEL: "yes"
5147
IPYTHON: "no"

0 commit comments

Comments
 (0)