2022-06-09 13:27:39 +03:00
|
|
|
### This workflow setup instance then build and push images ###
|
|
|
|
name: Multi-arch build stable
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*-stable"
|
|
|
|
|
|
|
|
env:
|
|
|
|
COMPANY_NAME: "onlyoffice"
|
|
|
|
PRODUCT_NAME: "documentserver"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2022-08-29 11:40:25 +03:00
|
|
|
name: "Release image: DocumentServer${{ matrix.edition }}"
|
2022-06-09 13:27:39 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2022-08-30 14:33:23 +03:00
|
|
|
fail-fast: false
|
2022-06-09 13:27:39 +03:00
|
|
|
matrix:
|
|
|
|
images: ["documentserver-stable"]
|
2022-06-10 15:43:50 +03:00
|
|
|
edition: ["", "-ee", "-de"]
|
2022-06-09 13:27:39 +03: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 11:40:25 +03:00
|
|
|
uses: docker/login-action@v2
|
2022-06-09 13:27:39 +03:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
|
|
|
|
- name: Get Tag Name
|
|
|
|
id: tag_name
|
|
|
|
run: |
|
|
|
|
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
|
|
|
|
|
2022-07-11 13:27:43 +03:00
|
|
|
- name: Build documentserver-release
|
2022-06-09 13:27:39 +03:00
|
|
|
run: |
|
2022-06-10 15:43:50 +03:00
|
|
|
TAG=$(echo ${{ steps.tag_name.outputs.SOURCE_TAG }} | sed 's/^.//; s/-stable//')
|
|
|
|
SHORTER_TAG=$(echo ${TAG} | grep -o -P '^[\d]+\.[\d]+\.[\d]+')
|
|
|
|
SHORTEST_TAG=$(echo ${TAG} | grep -o -P '^[\d]+\.[\d]+')
|
|
|
|
IMAGE_STATUS=$(docker manifest inspect ${{ env.COMPANY_NAME }}/4testing-${{ env.PRODUCT_NAME }}${{ matrix.edition }}:$TAG > /dev/null ; echo $?)
|
2022-06-09 13:27:39 +03:00
|
|
|
if [[ "$IMAGE_STATUS" = "0" ]]; then
|
|
|
|
echo "Image present on docker.hub >> start build stable version"
|
2022-08-29 11:40:25 +03:00
|
|
|
PRODUCT_EDITION=${{ matrix.edition }} \
|
|
|
|
PRODUCT_NAME=${{ env.PRODUCT_NAME }} \
|
|
|
|
COMPANY_NAME=${{ env.COMPANY_NAME}} \
|
2022-06-10 15:43:50 +03:00
|
|
|
TAG=$TAG \
|
|
|
|
SHORTER_TAG=$SHORTER_TAG \
|
|
|
|
SHORTEST_TAG=$SHORTEST_TAG \
|
2022-06-09 13:27:39 +03:00
|
|
|
docker buildx bake \
|
|
|
|
-f docker-bake.hcl ${{ matrix.images }} \
|
2022-07-11 13:27:43 +03:00
|
|
|
--push
|
|
|
|
echo "DONE: Build success >> exit with 0"
|
2022-06-09 13:27:39 +03:00
|
|
|
exit 0
|
2022-07-11 13:27:43 +03:00
|
|
|
else
|
|
|
|
echo "FAILED: Image with tag $TAG do not presented on docker.hub >> build will not started >> exit with 1"
|
|
|
|
exit 1
|
2022-06-09 13:27:39 +03:00
|
|
|
fi
|
|
|
|
shell: bash
|
2022-08-29 11:40:25 +03:00
|
|
|
|
|
|
|
build-nonExample:
|
|
|
|
name: "Release image: DocumentServer${{ matrix.edition }}-nonExample"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [build]
|
2022-08-30 14:33:23 +03:00
|
|
|
if: always()
|
2022-08-29 11:40:25 +03:00
|
|
|
strategy:
|
2022-08-30 14:33:23 +03:00
|
|
|
fail-fast: false
|
2022-08-29 11:40:25 +03: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: Get Tag Name
|
|
|
|
id: tag_name
|
|
|
|
run: |
|
|
|
|
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
|
|
|
|
|
|
|
|
- name: build image
|
|
|
|
run: |
|
|
|
|
TAG=$(echo ${{ steps.tag_name.outputs.SOURCE_TAG }} | sed 's/^.//; s/-stable//')
|
|
|
|
PRODUCT_EDITION=${{ matrix.edition }} \
|
|
|
|
PRODUCT_NAME=${{ env.PRODUCT_NAME }} \
|
|
|
|
COMPANY_NAME=${{ env.COMPANY_NAME }} \
|
|
|
|
TAG=$TAG \
|
|
|
|
docker buildx bake \
|
|
|
|
-f docker-bake.hcl ${{ matrix.images }} \
|
|
|
|
--push
|
|
|
|
shell: bash
|