fix: Outputs not working
Some checks failed
Build / build (push) Has been cancelled

This commit is contained in:
Jiří Štefka 2024-01-27 03:28:43 +01:00
parent fd38c9a98b
commit abd8c8fc95
Signed by: jiriks74
GPG Key ID: 1D5E30D3DB2264DE

@ -10,14 +10,10 @@ on:
jobs:
build:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.meta.outputs.tags }}
steps:
- name: Checkout
uses: actions/checkout@v4
# with:
# path: my-repo
- name: Install Docker
run: |
apt-get update
@ -29,32 +25,27 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
# driver-opts: network=host
platforms: linux/amd64,linux/arm64
- name: Get upstream repository
run: git clone https://github.com/ONLYOFFICE/DocumentServer upstream && ls -la
run: |
git clone https://github.com/ONLYOFFICE/DocumentServer/ upstream
- name: Extract tags and labels for Docker
id: meta
# working-directory: upstream
run: |
# export latest_tag=$(git describe --tags --abbrev=0 | cut -d 'v' -f2-)
# export tags="jiriks74/onlyoffice-documentserver:$(git describe --tags --abbrev=0 | cut -d 'v' -f2-),jiriks74/onlyoffice-documentserver:latest"
echo "tags=jiriks74/onlyoffice-documentserver:$(cd upstream && git describe --tags --abbrev=0 | cut -d 'v' -f2-),jiriks74/onlyoffice-documentserver:latest" >> "$GITEA_OUTPUT"
echo "tags=jiriks74/onlyoffice-documentserver:$(cd upstream && git describe --tags --abbrev=0 | cut -d 'v' -f2-),jiriks74/onlyoffice-documentserver:latest"
# echo $tags
# echo "tags=$(echo $tags)" >> "$GITEA_OUTPUT"
# echo "tags=$(echo $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
echo "$(cd upstream && git describe --tags --abbrev=0 | cut -d 'v' -f2-)"
echo "tag=$(cd upstream && git describe --tags --abbrev=0 | cut -d 'v' -f2-)" >> $GITHUB_OUTPUT
shell: bash
- 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
if curl --silent -f -lSL "https://hub.docker.com/v2/repositories/jiriks74/onlyoffice-documentserver/tags/$(echo ${{ steps.meta.outputs.tags }} | cut -d ':' -f2)" > /dev/null; then echo "Desn't exist" && exit 0; else echo "Already existst" && exit 1; fi
- 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: Login to DockerHub
uses: docker/login-action@v1
@ -66,8 +57,7 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ needs.build.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
tags: jiriks74/onlyoffice-documentserver:${{ steps.meta.outputs.tag }},jiriks74/onlyoffice-documentserver:latest
platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile