Update dev-image.yml

This commit is contained in:
Marvin
2025-10-06 21:37:22 +02:00
committed by GitHub
parent e2534af40e
commit 62df92f63a

View File

@@ -13,6 +13,12 @@ on:
jobs: jobs:
docker: docker:
runs-on: ubuntu-latest 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: steps:
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v3
@@ -28,9 +34,9 @@ jobs:
with: with:
platforms: linux/amd64 platforms: linux/amd64
push: true push: true
tags: ${{ secrets.DOCKER_HUB_REPO }}:dev-pr${{ github.event.pull_request.number }} tags: ${{ env.TAG }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_REPO }}:buildcache cache-from: type=registry,ref=${{ vars.DOCKER_HUB_REPO }}:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_REPO }}:buildcache,mode=max cache-to: type=registry,ref=${{ vars.DOCKER_HUB_REPO }}:buildcache,mode=max
build-args: DATABASE=sqlite build-args: DATABASE=sqlite
- name: Build and push Docker image PG - name: Build and push Docker image PG
@@ -38,33 +44,32 @@ jobs:
with: with:
platforms: linux/amd64 platforms: linux/amd64
push: true push: true
tags: ${{ secrets.DOCKER_HUB_REPO }}:postgresql-dev-pr${{ github.event.pull_request.number }} tags: ${{ env.TAG_PG }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_REPO }}:buildcache-pg cache-from: type=registry,ref=${{ vars.DOCKER_HUB_REPO }}:buildcache-pg
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_REPO }}:buildcache-pg,mode=max cache-to: type=registry,ref=${{ vars.DOCKER_HUB_REPO }}:buildcache-pg,mode=max
build-args: DATABASE=pg build-args: DATABASE=pg
- uses: actions/github-script@v8 - 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: with:
script: | script: |
const repo = process.env.REPO; const repoUrl = process.env.TAG_URL;
const devPr = process.env.DEV_PR; const tag = process.env.TAG;
const devPrPg = process.env.DEV_PR_PG; const tagPg = process.env.TAG_PG;
github.rest.issues.createComment({ github.rest.issues.createComment({
issue_number: context.issue.number, issue_number: context.issue.number,
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
body: `👋 Thanks for your PR! body: `👋 Thanks for your PR!
Dev images for this PR are now available on [docker hub](${repo}): Dev images for this PR are now available on [docker hub](${repoUrl}):
**SQLITE Image**
**SQLITE Image:**
\`\`\` \`\`\`
${devPr} ${tag}
\`\`\` \`\`\`
**Postgresql Image**
**Postgresql Image:**
\`\`\` \`\`\`
${devPrPg} ${tagPg}
\`\`\`` \`\`\``
}) })