Files
homarr/.github/workflows/on-pr-docker-publish.yml
T

64 lines
1.5 KiB
YAML

name: "[PR] Publish Docker preview image"
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- dev
permissions:
contents: read
packages: write
env:
SKIP_ENV_VALIDATION: true
REGISTRY: ghcr.io
GHCR_REPO: ghcr.io/${{ github.repository }}
TURBO_TELEMETRY_DISABLED: 1
concurrency:
group: pr-docker-${{ github.event.number }}
cancel-in-progress: true
jobs:
build-and-push:
name: Build and push PR preview image
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
with:
images: "${{ env.GHCR_REPO }}"
tags: |
type=raw,value=homarr-test-pr-${{ github.event.number }}
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
network: host
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
env:
SKIP_ENV_VALIDATION: true