From a2021b74baaf0e501893fbcb14fb7fcba7136e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Mon, 19 Oct 2020 17:56:30 -0700 Subject: [PATCH] Generate Docker tag from GitHub Action --- .github/workflows/docker.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 507bce9b..78b071e1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,7 +1,7 @@ name: Docker on: schedule: - - cron: '0 20 * * *' + - cron: '0 1 * * *' push: tags: - '*.*.*' @@ -12,6 +12,21 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Generate Docker tag + id: docker_tag + run: | + DOCKER_IMAGE=miniflux/miniflux + DOCKER_VERSION=dev + if [ "${{ github.event_name }}" = "schedule" ]; then + DOCKER_VERSION=nightly + elif [[ $GITHUB_REF == refs/tags/* ]]; then + DOCKER_VERSION=${GITHUB_REF#refs/tags/} + fi + TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION}" + echo ::set-output name=version::${DOCKER_VERSION} + echo ::set-output name=tags::${TAGS} + echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') + - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -31,3 +46,4 @@ jobs: file: ./packaging/docker/Dockerfile platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 push: true + tags: ${{ steps.docker_tag.outputs.tags }}