2023-10-17 13:46:52 +02:00
name : Build
on :
schedule :
- cron : "0 0 * * 1"
2023-11-21 19:26:40 +01:00
push :
tags :
- 'manual_build'
2023-10-17 13:46:52 +02:00
jobs :
build :
2024-01-27 03:05:57 +01:00
runs-on : ubuntu-latest
outputs :
tags : ${{ steps.meta.outputs.tags }}
2023-10-17 13:46:52 +02:00
steps :
- name : Checkout
2024-01-27 02:44:09 +01:00
uses : actions/checkout@v4
2024-01-27 02:55:35 +01:00
# with:
# path: my-repo
2023-10-17 13:46:52 +02:00
- name : Install Docker
run : |
apt-get update
apt-get install docker.io -y
- name : Set up QEMU
uses : docker/setup-qemu-action@v2
2024-01-27 02:34:42 +01:00
2023-10-17 13:46:52 +02:00
- name : Set up Docker Buildx
uses : docker/setup-buildx-action@v1
with :
# driver-opts: network=host
platforms : linux/amd64,linux/arm64
2024-01-27 02:34:42 +01:00
- name : Get upstream repository
2024-01-27 02:55:35 +01:00
run : git clone https://github.com/ONLYOFFICE/DocumentServer upstream && ls -la
2024-01-27 02:34:42 +01:00
- name : Extract tags and labels for Docker
id : meta
2024-01-27 03:05:57 +01:00
run : |
export latest_tag=$(git describe --tags --abbrev=0 | cut -d 'v' -f2-)
export tags="jiriks74/onlyoffice-documentserver:${latest_tag},jiriks74/onlyoffice-documentserver:latest"
echo $tags
echo "tags=${tags}" >> "$GITEA_OUTPUT"
echo "tags=${tags}"
if curl --silent -f -lSL "https://hub.docker.com/v2/repositories/jiriks74/onlyoffice-documentserver/tags/${docker_tag}" > /dev/null; then exit 1; else exit 0; fi
shell : bash
2024-01-27 02:34:42 +01:00
- name : Check if the image was already built
id : check-build-status
run : |
echo ${{ steps.meta.outputs.tags }}
docker_tag=$(echo ${{ steps.meta.outputs.tags }} | cut -d ':' -f2)
if curl --silent -f -lSL "https://hub.docker.com/v2/repositories/jiriks74/onlyoffice-documentserver/tags/${docker_tag}" > /dev/null; then exit 1; else exit 0; fi
- name : Login to DockerHub
uses : docker/login-action@v1
with :
username : ${{ secrets.DOCKERHUB_USERNAME }}
password : ${{ secrets.DOCKERHUB_TOKEN }}
2023-10-17 13:46:52 +02:00
- name : Build and push image
uses : docker/build-push-action@v2
with :
push : true
2024-01-27 03:05:57 +01:00
tags : ${{ needs.build.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
2023-10-17 13:46:52 +02:00
platforms : linux/amd64,linux/arm64
context : .
file : ./Dockerfile