Skip to content

manual-docker-release #6

manual-docker-release

manual-docker-release #6

name: manual-docker-release
env:
GPG_KEY_ID_GITHUB_TECHUSER: '${{ secrets.GPG_KEY_ID_GITHUB_TECHUSER }}'
PROJECT_NAME: ${GITHUB_REPOSITORY#*/}
DOCKER_BAKE_PLATFORM: linux/amd64,linux/arm64
on:
push:
tags:
- dookug-*
workflow_dispatch:
inputs:
comment:
# Friendly description to be shown in the UI instead of 'name'
description: 'Comment for release'
# Default value if no value is explicitly provided
default: 'Start docker release from WEB UI'
# Input has to be provided for the workflow to run
required: true
jobs:
docker-build:
runs-on: ubuntu-latest
# run only on main or tags
if: ((github.ref_name == 'main' && contains('["rombow","czenczl","petrenyi-mark","speter555","bucherarnold","biromate","cserhatit"]', github.actor)) || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')))
steps:
- name: Checkout
uses: actions/checkout@v4
# Get version from POM_XML_PROJECT_VERSION
- id: getVersion
name: getVersion into POM_XML_PROJECT_VERSION variable
run: |
sudo apt-get install libxml2-utils
PROJECT_VERSION=`echo -e 'setns x=http://maven.apache.org/POM/4.0.0\ncat /x:project/x:version/text()' | xmllint --shell pom.xml | grep -v /`
echo "PROJECT_VERSION=${PROJECT_VERSION}" >> $GITHUB_OUTPUT
# Set RELEASED_VERSION
- id: prepare
name: Set RELEASED_VERSION into etc/release/.env
run: |
echo "RELEASED_VERSION="${{steps.getVersion.outputs.PROJECT_VERSION}} >> etc/release/.env
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
# build multiplatform docker images
- name: docker buildx bake
uses: docker/bake-action@v5
with:
workdir: etc/release
set: |
*.platform=${{ env.DOCKER_BAKE_PLATFORM }}
push: true
files: |
release.docker-compose.yml
targets: dookug-rest-service-oracle-release,dookug-rest-service-postgres-release