mirror of
https://github.com/thomisus/Docker-DocumentServer.git
synced 2026-07-09 17:18:49 +00:00
221 lines
7.2 KiB
YAML
221 lines
7.2 KiB
YAML
### This workflow setup instance then build and push images ###
|
|
name: Multi-arch build stable
|
|
run-name: ${{ inputs.tag }} (${{ inputs.release_number }}) — ${{ inputs.community && 'CE ' || '' }}${{ inputs.enterprise && 'EE DE' || '' }}
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Tag for release (ex. 1.2.3.45)'
|
|
type: string
|
|
required: true
|
|
release_number:
|
|
description: 'Sequence number of the release (ex. x.x.x.<number>)'
|
|
type: string
|
|
required: true
|
|
default: '1'
|
|
latest:
|
|
description: 'Push latest tag?'
|
|
type: boolean
|
|
required: true
|
|
default: true
|
|
community:
|
|
type: boolean
|
|
description: 'Release Community Edition'
|
|
default: true
|
|
enterprise:
|
|
type: boolean
|
|
description: 'Release Enterprise editions (-ee and -de)'
|
|
default: true
|
|
|
|
env:
|
|
COMPANY_NAME: "onlyoffice"
|
|
PRODUCT_NAME: "documentserver"
|
|
VERSION: ${{ github.event.inputs.tag }}
|
|
RELEASE_NUMBER: ${{ github.event.inputs.release_number }}
|
|
LATEST: ${{ github.event.inputs.latest }}
|
|
|
|
jobs:
|
|
setup:
|
|
name: "Prepare editions matrix"
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
editions: ${{ steps.set.outputs.editions }}
|
|
editions_ucs: ${{ steps.set.outputs.editions_ucs }}
|
|
steps:
|
|
- name: Build editions list
|
|
id: set
|
|
shell: bash
|
|
env:
|
|
INPUT_C: ${{ github.event.inputs.community }}
|
|
INPUT_E: ${{ github.event.inputs.enterprise }}
|
|
run: |
|
|
set -eux
|
|
editions=$(jq -nc \
|
|
--argjson c "$INPUT_C" \
|
|
--argjson e "$INPUT_E" \
|
|
'[ if $c then "" else empty end,
|
|
if $e then ("-ee", "-de") else empty end ]')
|
|
editions_ucs=$(echo "$editions" | jq -c 'map(select(. != "-de"))')
|
|
echo "editions=$editions" >> "$GITHUB_OUTPUT"
|
|
echo "editions_ucs=$editions_ucs" >> "$GITHUB_OUTPUT"
|
|
echo "Matrix editions: $editions"
|
|
echo "Matrix editions (UCS): $editions_ucs"
|
|
|
|
build:
|
|
name: "Release image: DocumentServer${{ matrix.edition }}"
|
|
runs-on: ubuntu-latest
|
|
needs: [setup]
|
|
if: ${{ needs.setup.outputs.editions != '[]' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
images: ["documentserver-stable"]
|
|
edition: ${{ fromJSON(needs.setup.outputs.editions) }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
- name: Build documentserver-release
|
|
env:
|
|
TARGET: ${{ matrix.images }}
|
|
PRODUCT_EDITION: ${{ matrix.edition }}
|
|
run: |
|
|
set -eux
|
|
TESTING_IMAGE=${COMPANY_NAME}/4testing-${PRODUCT_NAME}${PRODUCT_EDITION}
|
|
export PRODUCT_EDITION
|
|
export PULL_TAG=${VERSION}
|
|
export TAG=${VERSION%.*}.${RELEASE_NUMBER}
|
|
export SHORTER_TAG=${VERSION%.*}
|
|
export SHORTEST_TAG=${VERSION%.*.*}
|
|
docker buildx bake --sbom=true --provenance=mode=max -f docker-bake.hcl "${TARGET}" --push
|
|
echo "DONE: Build success >> exit with 0"
|
|
exit 0
|
|
shell: bash
|
|
|
|
# Disable for now
|
|
# Related with issue:
|
|
# https://github.com/peter-evans/dockerhub-description/issues/294
|
|
#
|
|
#- name: Update Docker Hub README
|
|
# uses: peter-evans/dockerhub-description@v4
|
|
# with:
|
|
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
# repository: ${{ env.COMPANY_NAME }}/${{ env.PRODUCT_NAME }}${{ matrix.edition }}
|
|
|
|
release_4enterprise:
|
|
name: "Release image: onlyoffice4enterprise"
|
|
runs-on: ubuntu-latest
|
|
needs: [setup]
|
|
if: ${{ github.event.inputs.enterprise == 'true' }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME_ENTERPRISE }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN_ENTERPRISE }}
|
|
|
|
- name: release 4enterpise
|
|
shell: bash
|
|
run: |
|
|
export TAG=${VERSION%.*}.${RELEASE_NUMBER}
|
|
docker buildx imagetools create --tag onlyoffice4enterprise/documentserver-ee:${TAG} \
|
|
onlyoffice/4testing-documentserver-ee:${VERSION}
|
|
|
|
build-nonexample:
|
|
name: "Release image: DocumentServer${{ matrix.edition }}-nonExample"
|
|
runs-on: ubuntu-latest
|
|
needs: [build, setup]
|
|
if: ${{ false }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
images: ["documentserver-nonexample"]
|
|
edition: ${{ fromJSON(needs.setup.outputs.editions) }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
- name: build image
|
|
env:
|
|
TARGET: ${{ matrix.images }}
|
|
PRODUCT_EDITION: ${{ matrix.edition }}
|
|
run: |
|
|
set -eux
|
|
export PULL_TAG=${VERSION%.*}.${RELEASE_NUMBER}
|
|
export TAG=${VERSION%.*}.${RELEASE_NUMBER}
|
|
docker buildx bake --sbom=true --provenance=mode=max -f docker-bake.hcl "${TARGET}" --push
|
|
shell: bash
|
|
|
|
build-ucs-ubuntu20:
|
|
name: "Release image: DocumentServer${{ matrix.edition }}-ucs"
|
|
runs-on: ubuntu-latest
|
|
if: ${{ needs.setup.outputs.editions_ucs != '[]' }}
|
|
needs: [setup]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
edition: ${{ fromJSON(needs.setup.outputs.editions_ucs) }}
|
|
platform: ["amd64"]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
- name: build UCS
|
|
env:
|
|
PACKAGE_BASEURL: ${{ secrets.REPO_BASEURL }}
|
|
PRODUCT_EDITION: ${{ matrix.edition }}
|
|
PLATFORM: linux/${{ matrix.platform }}
|
|
run: |
|
|
set -eux
|
|
export DOCKERFILE=Dockerfile
|
|
export BASE_VERSION=20.04
|
|
export PG_VERSION=12
|
|
export PACKAGE_SUFFIX=
|
|
export TAG=${VERSION%.*}.${RELEASE_NUMBER}
|
|
export PACKAGE_VERSION=$( echo ${VERSION} | sed -E 's/(.*)\./\1-/')
|
|
docker buildx bake --sbom=true --provenance=mode=max -f docker-bake.hcl documentserver-ucs --push
|
|
shell: bash
|