Ver código fonte

Generate Docker tag from GitHub Action

Frédéric Guillot 5 anos atrás
pai
commit
a2021b74ba
1 arquivos alterados com 17 adições e 1 exclusões
  1. 17 1
      .github/workflows/docker.yml

+ 17 - 1
.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 }}