forked from Cytomine-ULiege/pims
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (73 loc) · 2.55 KB
/
docker.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Docker
on:
push:
tags:
- "*.*.*"
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Set up the repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Release check
id: release
run: |
if [[ ${{ github.ref_name }} =~ ^bp-(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
echo "release=true" >> $GITHUB_OUTPUT
else
echo "release=false" >> $GITHUB_OUTPUT
fi
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: cytomineuliege/pims
tags: |
type=raw,value=${{ github.ref_name }}
- name: Build and push pims
uses: docker/build-push-action@v4
with:
build-args: |
BMI=${{ secrets.BMI }}
CF=${{ secrets.CF }}
ENTRYPOINT_SCRIPTS_VERSION=${{ vars.ENTRYPOINT_SCRIPTS_VERSION }}
GUNICORN_VERSION=${{ vars.GUNICORN_VERSION }}
OPENJPEG_URL=${{ vars.OPENJPEG_URL }}
OPENJPEG_VERSION=${{ vars.OPENJPEG_VERSION }}
PIMS_REVISION=${{ github.sha }}
PIMS_VERSION=${{ github.ref_name }}
PY_VERSION=${{ vars.PYTHON_VERSION }}
SETUPTOOLS_VERSION=${{ vars.SETUPTOOLS_VERSION }}
UBUNTU_VERSION=${{ vars.UBUNTU_VERSION }}
VIPS_URL=${{ vars.VIPS_URL }}
VIPS_VERSION=${{ vars.VIPS_VERSION }}
context: .
file: ./docker/backend.dockerfile
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}
- name: Extract metadata (tags, labels) for Docker
id: meta-worker
uses: docker/metadata-action@v5
with:
images: cytomineuliege/pims-worker
tags: |
type=raw,value=${{ github.ref_name }}
- name: Build and push pims-worker
uses: docker/build-push-action@v4
with:
build-args: |
FROM_NAMESPACE=cytomineuliege
FROM_VERSION=${{ github.ref_name }}
context: .
file: ./docker/worker.dockerfile
labels: ${{ steps.meta-worker.outputs.labels }}
push: true
tags: ${{ steps.meta-worker.outputs.tags }}