diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 429971c..16bddfc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,6 +13,17 @@ jobs: docker: runs-on: ubuntu-latest steps: + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.DOCKERHUB_REPO }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}}.{{patch}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -25,18 +36,13 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Generate APP Version - run: echo APP_VERSION=`git describe --tags --always` >> $GITHUB_ENV - name: Build and push uses: docker/build-push-action@v5 with: + context: . push: true - platforms: | - linux/amd64 build-args: | APP_NAME=${{ env.APP_NAME }} - APP_VERSION=${{ env.APP_VERSION }} - tags: | - ${{ env.DOCKERHUB_REPO }}:latest - ${{ env.DOCKERHUB_REPO }}:${{ env.APP_VERSION }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file