mirror of
https://github.com/ONLYOFFICE/Docker-DocumentServer.git
synced 2026-02-10 12:35:25 +08:00
179 lines
5.5 KiB
YAML
179 lines
5.5 KiB
YAML
### This workflow setup instance then build and push images ###
|
|
name: Multi-arch build stable
|
|
run-name: ${{ inputs.tag }} (${{ inputs.release_number }})
|
|
|
|
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
|
|
|
|
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:
|
|
build:
|
|
name: "Release image: DocumentServer${{ matrix.edition }}"
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
images: ["documentserver-stable"]
|
|
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 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
|
|
|
|
- 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
|
|
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_PAT }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN_PAT }}
|
|
|
|
- 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]
|
|
if: ${{ false }}
|
|
strategy:
|
|
fail-fast: false
|
|
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
|
|
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
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
edition: ["", "-ee"]
|
|
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 UCS
|
|
env:
|
|
PACKAGE_BASEURL: ${{ secrets.REPO_BASEURL }}
|
|
PRODUCT_EDITION: ${{ matrix.edition }}
|
|
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
|