diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml index 9173a17..c717522 100644 --- a/.github/workflows/docker-build-push.yaml +++ b/.github/workflows/docker-build-push.yaml @@ -4,6 +4,8 @@ on: push: branches: - "main" + tags: + - "v*.*.*" jobs: docker: @@ -11,6 +13,32 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: Release ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.tag_version.outputs.changelog }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + gitea.proompteng.ai/d/lab/ecran + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx @@ -28,7 +56,8 @@ jobs: context: ./apps/ecran file: ./apps/ecran/Dockerfile push: true - tags: gitea.proompteng.ai/d/lab/ecran:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=gitea.proompteng.ai/d/lab/ecran:latest cache-to: type=inline - name: Build and push ledos