-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) · 2.18 KB
/
docker_build.yaml
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
name: Build docker image with the presentation
on:
push:
branches: [master]
workflow_dispatch:
inputs:
reason:
description: Why did you need to rebuild the image?
required: False
default: Image built from master was outdated
jobs:
docker_build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/[email protected]
with:
fetch-depth: 0
lfs: true
persist-credentials: false
# lfs=true is not enough, see https://stackoverflow.com/questions/61463578/github-actions-actions-checkoutv2-lfs-true-flag-not-converting-pointers-to-act
- name: Pull LFS Objects
run: git lfs pull
- name: validate notebooks
run: |
for notebook in notebooks/*.ipynb; do
if grep -q '# *%load ' "$notebook"; then
echo "$notebook contains an executed load statement.
This is not allowed inside the docker image for participants, make sure you remove this
in a future commit."
exit 255
fi
done
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GAR
uses: docker/login-action@v1
with:
registry: europe-west3-docker.pkg.dev
username: _json_key
password: ${{ secrets.GAR_JSON_KEY }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
flavor: |
latest=true
images: europe-west3-docker.pkg.dev/tfl-prod-ea3b/tfl-docker/tfl_training_anomaly_detection
tags: |
type=sha
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args:
PARTICIPANT_BUCKET_READ_SECRET=${{ secrets.PARTICIPANT_BUCKET_READ_SECRET }}
cache-from: type=registry,ref=europe-west3-docker.pkg.dev/tfl-prod-ea3b/tfl-docker/tfl_training_anomaly_detection
cache-to: type=inline