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

View file

@ -10,13 +10,9 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
tags: ${{ steps.meta.outputs.tags }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
# with:
# path: my-repo
- name: Install Docker - name: Install Docker
run: | run: |
@ -29,32 +25,27 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
with: with:
# driver-opts: network=host
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
- name: Get upstream repository - 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 - name: Extract tags and labels for Docker
id: meta id: meta
# working-directory: upstream
run: | run: |
# export latest_tag=$(git describe --tags --abbrev=0 | cut -d 'v' -f2-) echo "$(cd upstream && 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 "tag=$(cd upstream && git describe --tags --abbrev=0 | cut -d 'v' -f2-)" >> $GITHUB_OUTPUT
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
shell: bash shell: bash
- name: Check if the image was already built - name: Check if the image was already built
id: check-build-status id: check-build-status
run: | run: |
echo ${{ steps.meta.outputs.tags }} 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
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: 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 - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
@ -66,8 +57,7 @@ jobs:
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
push: true push: true
tags: ${{ needs.build.outputs.tags }} tags: jiriks74/onlyoffice-documentserver:${{ steps.meta.outputs.tag }},jiriks74/onlyoffice-documentserver:latest
# labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
context: . context: .
file: ./Dockerfile file: ./Dockerfile