-
Notifications
You must be signed in to change notification settings - Fork 7
74 lines (58 loc) · 2.52 KB
/
docker-images-tagged.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
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Release tagged image
on:
push:
tags:
- '*'
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
WORKER_IMAGE_NAME: verapdf_worker
FILE_STORAGE_IMAGE_NAME: verapdf_file-storage
JOB_SERVICE_IMAGE_NAME: verapdf_job-service
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.11
uses: actions/setup-java@v1
with:
java-version: 1.11
- name: Update git submodule for veraPDF-validation-profiles
run: git submodule update --init --remote --recursive
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Get tag name
id: tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Build file-storage-service Docker image
env:
RELEASE_VERSION: ${{ steps.tag.outputs.tag }}
run: docker build ./local-storage-service/server -f "./local-storage-service/server/Dockerfile-dev" -t $REGISTRY/verapdf/$FILE_STORAGE_IMAGE_NAME:$RELEASE_VERSION
- name: Build job-service Docker image
env:
RELEASE_VERSION: ${{ steps.tag.outputs.tag }}
run: docker build ./job-service/server -f "./job-service/server/Dockerfile-dev" -t $REGISTRY/verapdf/$JOB_SERVICE_IMAGE_NAME:$RELEASE_VERSION
- name: Build worker-service Docker image
env:
RELEASE_VERSION: ${{ steps.tag.outputs.tag }}
run: docker build ./worker -f "./worker/Dockerfile-dev" -t $REGISTRY/verapdf/$WORKER_IMAGE_NAME:$RELEASE_VERSION
- name: Login into ${{ env.REGISTRY }}
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push file-storage-service Docker images to the ${{ env.REGISTRY }}
env:
RELEASE_VERSION: ${{ steps.tag.outputs.tag }}
run : docker push $REGISTRY/verapdf/$FILE_STORAGE_IMAGE_NAME:$RELEASE_VERSION
- name: Push job-service Docker images to the ${{ env.REGISTRY }}
env:
RELEASE_VERSION: ${{ steps.tag.outputs.tag }}
run: docker push $REGISTRY/verapdf/$JOB_SERVICE_IMAGE_NAME:$RELEASE_VERSION
- name: Push worker Docker images to the ${{ env.REGISTRY }}
env:
RELEASE_VERSION: ${{ steps.tag.outputs.tag }}
run: docker push $REGISTRY/verapdf/$WORKER_IMAGE_NAME:$RELEASE_VERSION