Create pr-docker-build.yml

This commit is contained in:
egelhaus 2025-04-14 00:30:11 +02:00 committed by GitHub
parent 1769054b7c
commit ea2c271ccf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 30 additions and 0 deletions

30
.github/pr-docker-build.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Build and Publish PR Docker Image
on:
pull_request:
types: [opened, synchronize]
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set image tag
id: vars
run: echo "IMAGE_TAG=ghcr.io/gitroomhq/postiz-app-pr:${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: Build Docker image from Dockerfile.dev
run: docker build -f Dockerfile.dev -t $IMAGE_TAG .
- name: Push Docker image to GHCR
run: docker push $IMAGE_TAG