Skip to content

OPS-7069-fix-awx-workflow (#101) #102

OPS-7069-fix-awx-workflow (#101)

OPS-7069-fix-awx-workflow (#101) #102

Workflow file for this run

---
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 }}