2022-06-09 12:27:39 +02:00
|
|
|
### This workflow setup instance then build and push images ###
|
|
|
|
name: Multi-arch build stable
|
|
|
|
|
|
|
|
on:
|
2022-09-12 15:04:56 +02:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tag:
|
|
|
|
description: 'Tag for release (ex. 1.2.3.45)'
|
|
|
|
type: string
|
|
|
|
required: true
|
2022-06-09 12:27:39 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
COMPANY_NAME: "onlyoffice"
|
|
|
|
PRODUCT_NAME: "documentserver"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2022-08-29 10:40:25 +02:00
|
|
|
name: "Release image: DocumentServer${{ matrix.edition }}"
|
2022-06-09 12:27:39 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2022-08-30 13:33:23 +02:00
|
|
|
fail-fast: false
|
2022-06-09 12:27:39 +02:00
|
|
|
matrix:
|
|
|
|
images: ["documentserver-stable"]
|
2022-06-10 14:43:50 +02:00
|
|
|
edition: ["", "-ee", "-de"]
|
2022-06-09 12:27:39 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2022-08-29 10:40:25 +02:00
|
|
|
uses: docker/login-action@v2
|
2022-06-09 12:27:39 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
|
2022-07-11 12:27:43 +02:00
|
|
|
- name: Build documentserver-release
|
2022-06-09 12:27:39 +02:00
|
|
|
run: |
|
2022-09-12 15:04:56 +02:00
|
|
|
set -eux
|
|
|
|
VERSION=${{ github.event.inputs.tag }}
|
|
|
|
PRODUCT_EDITION=${{ matrix.edition }}
|
|
|
|
TESTING_IMAGE=${COMPANY_NAME}/4testing-${PRODUCT_NAME}${PRODUCT_EDITION}
|
|
|
|
if docker manifest inspect ${TESTING_IMAGE}:${VERSION} > /dev/null; then
|
|
|
|
echo "Image present on docker.hub >> start build stable version"
|
|
|
|
export PRODUCT_EDITION
|
|
|
|
export TAG=${VERSION}
|
|
|
|
export SHORTER_TAG=${VERSION%.*}
|
|
|
|
export SHORTEST_TAG=${VERSION%.*.*}
|
|
|
|
docker buildx bake -f docker-bake.hcl ${{ matrix.images }} --push
|
|
|
|
echo "DONE: Build success >> exit with 0"
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "FAILED: Image with tag ${VERSION} do not presented on docker.hub >> build will not started >> exit with 1"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-06-09 12:27:39 +02:00
|
|
|
shell: bash
|
2022-08-29 10:40:25 +02:00
|
|
|
|
2022-09-12 15:04:56 +02:00
|
|
|
build-nonexample:
|
2022-08-29 10:40:25 +02:00
|
|
|
name: "Release image: DocumentServer${{ matrix.edition }}-nonExample"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [build]
|
2022-08-30 13:33:23 +02:00
|
|
|
if: always()
|
2022-08-29 10:40:25 +02:00
|
|
|
strategy:
|
2022-08-30 13:33:23 +02:00
|
|
|
fail-fast: false
|
2022-08-29 10:40:25 +02:00
|
|
|
matrix:
|
|
|
|
images: ["documentserver-nonexample"]
|
|
|
|
edition: ["", "-ee", "-de"]
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
|
|
|
|
- name: build image
|
|
|
|
run: |
|
2022-09-12 15:04:56 +02:00
|
|
|
set -eux
|
|
|
|
export PRODUCT_EDITION=${{ matrix.edition }}
|
|
|
|
export TAG=${{ github.event.inputs.tag }}
|
|
|
|
docker buildx bake -f docker-bake.hcl ${{ matrix.images }} --push
|
2022-08-29 10:40:25 +02:00
|
|
|
shell: bash
|