updates
This commit is contained in:
16
.github/workflows/pr-build.yml
vendored
16
.github/workflows/pr-build.yml
vendored
@@ -3,6 +3,14 @@ name: PR Dev/Test Container
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
pr_number:
|
||||||
|
description: 'Pull request number (optional, for manual runs)'
|
||||||
|
required: false
|
||||||
|
branch:
|
||||||
|
description: 'Branch to build (optional, defaults to PR head or main)'
|
||||||
|
required: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
@@ -13,10 +21,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write # ✅ needed for GHCR push
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.inputs.branch || github.head_ref || github.ref }}
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
@@ -28,14 +38,14 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# Extract metadata for PR builds
|
# Extract Docker metadata
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=dev-pr-${{ github.event.pull_request.number }}
|
type=raw,value=dev-pr-${{ github.event.inputs.pr_number || github.event.pull_request.number }}
|
||||||
|
|
||||||
# Build and push multi-arch dev image
|
# Build and push multi-arch dev image
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
|
|||||||
Reference in New Issue
Block a user