CPT-111 Enable PDF-A generation after ghostscript update #162
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker Image | |
on: | |
push: | |
branches: | |
- 'jobrad-**' | |
tags: | |
- 'jobrad-**' | |
jobs: | |
build-docker-amd64: | |
runs-on: self-hosted | |
permissions: | |
contents: read | |
packages: write | |
env: | |
GHCR_IMAGE_NAME: ghcr.io/jobrad-gmbh/odoo | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create variables | |
shell: bash | |
run: | | |
echo "BRANCH_NAME=$(echo ${GITHUB_REF} | sed 's/refs\/heads\///' | sed 's/refs\/tags\///' | sed 's/\//_/g')" >> $GITHUB_ENV | |
echo "SHORT_REV=$(echo ${{ github.sha }})" >> $GITHUB_ENV | |
- name: Login to ghcr registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image (AMD64) | |
shell: bash | |
run: | | |
IMAGE="${GHCR_IMAGE_NAME}:${SHORT_REV}-amd64" | |
docker build . --platform linux/amd64 -f docker/Dockerfile -t "${IMAGE}" --pull | |
docker push "${IMAGE}" | |
build-docker-arm64: | |
runs-on: self-hosted | |
permissions: | |
contents: read | |
packages: write | |
env: | |
GHCR_IMAGE_NAME: ghcr.io/jobrad-gmbh/odoo | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- uses: actions/checkout@v3 | |
- name: Create variables | |
shell: bash | |
run: | | |
echo "BRANCH_NAME=$(echo ${GITHUB_REF} | sed 's/refs\/heads\///' | sed 's/refs\/tags\///' | sed 's/\//_/g')" >> $GITHUB_ENV | |
echo "SHORT_REV=$(echo ${{ github.sha }})" >> $GITHUB_ENV | |
- name: Login to ghcr registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image (ARM64) | |
shell: bash | |
run: | | |
IMAGE="${GHCR_IMAGE_NAME}:${SHORT_REV}-arm64" | |
docker buildx build . --platform linux/arm64 -f docker/Dockerfile -t "${IMAGE}" --pull --load | |
docker push "${IMAGE}" | |
combine-docker: | |
runs-on: [self-hosted, short] | |
needs: [build-docker-amd64, build-docker-arm64] | |
permissions: | |
contents: read | |
packages: write | |
env: | |
GHCR_IMAGE_NAME: ghcr.io/jobrad-gmbh/odoo | |
steps: | |
- name: Create variables | |
shell: bash | |
run: | | |
echo "BRANCH_NAME=$(echo ${GITHUB_REF} | sed 's/refs\/heads\///' | sed 's/refs\/tags\///' | sed 's/\//_/g')" >> $GITHUB_ENV | |
echo "SHORT_REV=$(echo ${{ github.sha }})" >> $GITHUB_ENV | |
- name: Login to ghcr registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to artifactory registry | |
uses: docker/login-action@v2 | |
with: | |
registry: artifactory.service.jobrad.org | |
username: github_runner | |
password: ${{ secrets.ARTIFACTORY_TOKEN }} | |
- name: Combine Docker images into a single multi-architecture image | |
shell: bash | |
run: | | |
IMAGE_AMD64="${GHCR_IMAGE_NAME}:${SHORT_REV}-amd64" | |
IMAGE_ARM64="${GHCR_IMAGE_NAME}:${SHORT_REV}-arm64" | |
IMAGE_BRANCH="${GHCR_IMAGE_NAME}:${BRANCH_NAME}" | |
IMAGE_REV="${GHCR_IMAGE_NAME}:${SHORT_REV}" | |
docker pull "${IMAGE_AMD64}" | |
docker pull "${IMAGE_ARM64}" | |
docker manifest rm "${IMAGE_BRANCH}" || true | |
docker manifest rm "${IMAGE_REV}" || true | |
docker manifest create "${IMAGE_BRANCH}" "${IMAGE_AMD64}" "${IMAGE_ARM64}" | |
docker manifest create "${IMAGE_REV}" "${IMAGE_AMD64}" "${IMAGE_ARM64}" | |
docker manifest push "${IMAGE_BRANCH}" | |
docker manifest push "${IMAGE_REV}" | |
# TODO Push to artifactory |