Docker-DocumentServer/.gitea/workflows/build.yml

67 lines
2.1 KiB
YAML
Raw Permalink Normal View History

name: Build
on:
schedule:
- cron: "0 0 * * 1"
2023-11-21 19:26:40 +01:00
push:
tags:
- 'manual_build'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get upstream repository
2024-01-27 03:28:43 +01:00
run: |
git clone https://github.com/ONLYOFFICE/DocumentServer/ upstream
- name: Extract tags and labels for Docker
id: meta
run: |
export VERSION="$(cd upstream && git describe --tags --abbrev=0 | cut -d 'v' -f2-)"
echo "Version: ${VERSION}"
echo "tag=${VERSION}" >> $GITHUB_OUTPUT
shell: bash
- name: Check if the image was already built
id: check-build-status
run: |
echo ${{ steps.meta.outputs.tag }}
if curl --silent -f -lSL "https://hub.docker.com/v2/repositories/jiriks74/onlyoffice-documentserver/tags/$(echo ${{ steps.meta.outputs.tag }})" > /dev/null; then echo "Already exists" && exit 1; else echo "Desn't exist" && exit 0; fi
2024-01-27 03:28:43 +01:00
- name: Set tag in Dockerfile
run: |
sed -i "s/ARG PACKAGE_VERSION=/ARG PACKAGE_VERSION=$(echo ${{ steps.meta.outputs.tag }} | cut -d ':' -f2)/g" Dockerfile
- name: Update repositories
run: sudo apt update
2024-09-22 23:05:26 +02:00
- name: Install Docker
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: docker.io
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
platforms: linux/amd64,linux/arm64
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v2
with:
push: true
2024-01-27 03:28:43 +01:00
tags: jiriks74/onlyoffice-documentserver:${{ steps.meta.outputs.tag }},jiriks74/onlyoffice-documentserver:latest
platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile