-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 2.07 KB
/
bapontag.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
---
name: Build and push Docker Image on Tag
on:
push:
tags:
- 'infra-tools-[0-9]+.[0-9]+.[0-9]+'
- 'dbcmetrics-[0-9]+.[0-9]+.[0-9]+'
- 'awx-ee-[0-9]+.[0-9]+.[0-9]+'
- 'cron-tools-[0-9]+.[0-9]+.[0-9]+'
jobs:
pre_build:
runs-on: ubuntu-latest
outputs:
nameTag: ${{ steps.nameTag.outputs.tag }}
registries: ${{ steps.registries.outputs.registries }}
steps:
- name: Filter Tag name
uses: olegtarasov/[email protected]
id: nameTag
with:
tagRegex: "(.+?(?=-[0-9]))" # unabhängig von dbmetrics und infra-tools gives name
tagRegexGroup: 1
- name: Determine registries
id: registries
run: |
if [[ "${{ steps.nameTag.outputs.tag }}" == 'infra-tools' ]]; then
echo "registries=dockerhub,quay.io" >> $GITHUB_OUTPUT
elif [[ "${{ steps.nameTag.outputs.tag }}" == 'dbcmetrics' ]]; then
echo "registries=dockerhub" >> $GITHUB_OUTPUT
elif [[ "${{ steps.nameTag.outputs.tag }}" == 'awx-ee' ]]; then
echo "registries=dockerhub" >> $GITHUB_OUTPUT
elif [[ "${{ steps.nameTag.outputs.tag }}" == 'cron-tools' ]]; then
echo "registries=dockerhub,quay.io" >> $GITHUB_OUTPUT
fi
build_and_push:
needs: pre_build
uses: dBildungsplattform/dbp-github-workflows/.github/workflows/image-publish-trivy.yaml@7
permissions:
packages: write
contents: read
security-events: write
with:
image_name: ${{ needs.pre_build.outputs.nameTag }}
container_registry: ${{ needs.pre_build.outputs.registries }}
dockerhub_repository_owner: "schulcloud"
quay_repository_owner: "schulcloudverbund"
add_latest_tag: true
image_tag_generation: "mmp_git_tag,mm_git_tag"
context: ${{ needs.pre_build.outputs.nameTag }}
run_trivy_scan: false
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}