-
Notifications
You must be signed in to change notification settings - Fork 10
62 lines (52 loc) · 1.78 KB
/
docker.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
name: Docker images
on:
workflow_dispatch:
push:
tags:
- 'v*'
schedule:
- cron: '17 21 * * *'
jobs:
build_test_env:
name: Build sblauth/cashocs-test-env image
runs-on: ubuntu-latest
outputs:
TAG_PREFIX: ${{ steps.tag_name.outputs.TAG_PREFIX }}
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Get tag name
id: tag_name
run: |
if [[ ${GITHUB_REF#refs/tags/} == v* ]]
then
echo "TAG_PREFIX=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "TAG_PREFIX=latest" >> $GITHUB_OUTPUT
fi
- name: Log into the Dockerhub registry
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build the Docker image
run: |
docker buildx build --push \
--no-cache \
--cache-to=type=inline,mode=max --file ./.github/docker/Dockerfile \
--target=test-env \
--tag sblauth/cashocs-test-env:${{ steps.tag_name.outputs.TAG_PREFIX }} .
build_user_image:
name: Build sblauth/cashocs image
needs:
- build_test_env
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Log into the Dockerhub registry
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build the Docker image
run: |
docker buildx build --push \
--no-cache \
--cache-to=type=inline,mode=max --file ./.github/docker/Dockerfile \
--target=cashocs \
--tag sblauth/cashocs:${{ needs.build_test_env.outputs.TAG_PREFIX }} .