Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/docker-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches: [master]
tags: ["v*", "*.*.*"]

concurrency:
group: docker-ghcr-${{ github.ref }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/docker-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Docker PR Build

on:
pull_request:
types: [opened, synchronize, labeled]

concurrency:
group: docker-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
# Only run when the PR has the 'run-ci' label
if: contains(github.event.pull_request.labels.*.name, 'run-ci')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Sanitize branch name
id: branch
run: |
RAW="${{ github.head_ref }}"
CLEAN=$(echo "$RAW" | sed 's/[^a-zA-Z0-9._-]/-/g')
echo "name=$CLEAN" >> "$GITHUB_OUTPUT"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix=,format=short
type=raw,value=${{ steps.branch.outputs.name }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.branch.outputs.name }}
REPO=${{ github.repository }}
OWNER=${{ github.repository_owner }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ token.toml

# Debug FCM build
crates/fcm-push-listener

# Planning and docs (local only)
.planning/
docs/plans/
tmp/
Loading
Loading