From 62df92f63a2a7448ac83d6739b84e34a55416df4 Mon Sep 17 00:00:00 2001 From: Marvin <127591405+Lokowitz@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:37:22 +0200 Subject: [PATCH] Update dev-image.yml --- .github/workflows/dev-image.yml | 41 ++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/dev-image.yml b/.github/workflows/dev-image.yml index c989944e..1f9ea0ae 100644 --- a/.github/workflows/dev-image.yml +++ b/.github/workflows/dev-image.yml @@ -13,6 +13,12 @@ on: jobs: docker: runs-on: ubuntu-latest + + env: + TAG_URL: https://hub.docker.com/r/${{ vars.DOCKER_HUB_REPO }}/tags + TAG: ${{ vars.DOCKER_HUB_REPO }}:dev-pr${{ github.event.pull_request.number }} + TAG_PG: ${{ vars.DOCKER_HUB_REPO }}:postgresql-dev-pr${{ github.event.pull_request.number }} + steps: - name: Login to Docker Hub uses: docker/login-action@v3 @@ -28,9 +34,9 @@ jobs: with: platforms: linux/amd64 push: true - tags: ${{ secrets.DOCKER_HUB_REPO }}:dev-pr${{ github.event.pull_request.number }} - cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_REPO }}:buildcache - cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_REPO }}:buildcache,mode=max + tags: ${{ env.TAG }} + cache-from: type=registry,ref=${{ vars.DOCKER_HUB_REPO }}:buildcache + cache-to: type=registry,ref=${{ vars.DOCKER_HUB_REPO }}:buildcache,mode=max build-args: DATABASE=sqlite - name: Build and push Docker image PG @@ -38,33 +44,32 @@ jobs: with: platforms: linux/amd64 push: true - tags: ${{ secrets.DOCKER_HUB_REPO }}:postgresql-dev-pr${{ github.event.pull_request.number }} - cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_REPO }}:buildcache-pg - cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_REPO }}:buildcache-pg,mode=max + tags: ${{ env.TAG_PG }} + cache-from: type=registry,ref=${{ vars.DOCKER_HUB_REPO }}:buildcache-pg + cache-to: type=registry,ref=${{ vars.DOCKER_HUB_REPO }}:buildcache-pg,mode=max build-args: DATABASE=pg - uses: actions/github-script@v8 - env: - REPO: https://hub.docker.com/r/${{ secrets.DOCKER_HUB_REPO }}/tags - DEV_PR: ${{ secrets.DOCKER_HUB_REPO }}:dev-pr${{ github.event.pull_request.number }} - DEV_PR_PG: ${{ secrets.DOCKER_HUB_REPO }}:postgresql-dev-pr${{ github.event.pull_request.number }} with: script: | - const repo = process.env.REPO; - const devPr = process.env.DEV_PR; - const devPrPg = process.env.DEV_PR_PG; + const repoUrl = process.env.TAG_URL; + const tag = process.env.TAG; + const tagPg = process.env.TAG_PG; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: `👋 Thanks for your PR! - Dev images for this PR are now available on [docker hub](${repo}): - **SQLITE Image** + Dev images for this PR are now available on [docker hub](${repoUrl}): + + **SQLITE Image:** \`\`\` - ${devPr} + ${tag} \`\`\` - **Postgresql Image** + + **Postgresql Image:** \`\`\` - ${devPrPg} + ${tagPg} \`\`\`` }) +