Docker-DocumentServer/.gitea/workflows/build.yml
Jiří Štefka c091b8908a
Some checks failed
Build / build (push) Failing after 49s
fix(cicd): move output to the end of job
2023-11-21 19:39:00 +01:00

68 lines
2.1 KiB
YAML

name: Build
on:
schedule:
- cron: "0 0 * * 1"
push:
tags:
- 'manual_build'
jobs:
build:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract Version Tag
id: extract-version
run: |
git clone https://github.com/ONLYOFFICE/DocumentServer
cd DocumentServer
docker_tag=$(git describe --tags --abbrev=0 | cut -d 'v' -f2-)
echo $docker_tag
if curl --silent -f -lSL "https://hub.docker.com/v2/repositories/jiriks74/onlyoffice-documentserver/tags/${docker_tag}" > /dev/null; then exit 1; fi
cd .. && rm -rf DocumentServer
echo "docker_tag=$(git describe --tags --abbrev=0 | cut -d 'v' -f2-)" >> GITHUB_OUTPUT
shell: bash
- name: Install Docker
if: steps.extract-version.conclusion == 'success'
run: |
apt-get update
apt-get install docker.io -y
- name: Login to DockerHub
if: steps.extract-version.conclusion == 'success'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
if: steps.extract-version.conclusion == 'success'
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: steps.extract-version.conclusion == 'success'
uses: docker/setup-buildx-action@v1
with:
# driver-opts: network=host
platforms: linux/amd64,linux/arm64
- name: Build and push image
if: steps.extract-version.conclusion == 'success'
uses: docker/build-push-action@v2
with:
push: true
tags: jiriks74/onlyoffice-documentserver:${{ steps.extract-version.outputs.docker_tag }},jiriks74/onlyoffice-documentserver:latest
platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile
- name: Image already built
id: image-built
if: steps.extract-version.conclusion == 'failure'
run: |
echo "Image was already built and uploaded"
exit 0
shell: bash