replaced branch build by PR build only (#203)

This commit is contained in:
Florian Asche authored and GitHub committed 2026-03-05 01:35:06 +01:00
1 parent 06d30ac95e
commit 5b1d3b75e2
2 files changed
+14 -18

No files matched your search

+5 -6
View File
@@ -8,7 +8,7 @@ This project uses three separate Docker build workflows that automatically build
|----------|---------|--------------|
| [docker-build-release.yml](.github/workflows/docker-build-release.yml) | Tags: `v1.2.0`, `v1.2.0-alpha1` | `1.2.0`, `1.2`, `latest` |
| [docker-build-nightly.yml](.github/workflows/docker-build-nightly.yml) | Push to `main` | `nightly` |
| [docker-build-branch.yml](.github/workflows/docker-build-branch.yml) | All other branches | Branch name |
| [docker-build-pr.yml](.github/workflows/docker-build-pr.yml) | Pull requests | `pr-<pr-number>` |
## Detailed Description
@@ -40,17 +40,16 @@ Automatically builds nightly images from the main branch.
ghcr.io/ohf-voice/linux-voice-assistant:nightly
```
### Branch Workflow (`docker-build-branch.yml`)
### PR Workflow (`docker-build-pr.yml`)
Builds images for all other branches.
Builds images for pull requests using the PR number as tag.
**Triggers:**
- Push to all branches except `main`
- No tags
- Pull request opened, synchronized, or reopened
**Image Tag:**
```
ghcr.io/ohf-voice/linux-voice-assistant:<branch-name>
ghcr.io/ohf-voice/linux-voice-assistant:pr-<pr-number>
```
## Multi-Architecture Support
@@ -1,11 +1,8 @@
name: Build branch
name: Build PR
on:
push:
branches-ignore:
- "main"
tags-ignore:
- "**"
pull_request:
types: [opened, synchronize, reopened]
env:
REGISTRY: ghcr.io
@@ -23,10 +20,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract clean branch name
id: extract_branch
- name: Extract PR information
id: extract_pr
run: |
echo "CLEAN_BRANCH_NAME=$(echo ${{ github.head_ref || github.ref_name }} | sed 's|.*/||')" >> $GITHUB_ENV
echo "PR_NUMBER=${{ github.event.number }}" >> $GITHUB_ENV
echo "REGISTRY_LOWER=$(echo '${{ env.REGISTRY }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "REPOSITORY_LOWER=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
@@ -46,7 +43,7 @@ jobs:
- name: Create version files
run: |
echo "${{ env.CLEAN_BRANCH_NAME }}" > version.txt
echo "pr-${{ env.PR_NUMBER }}" > version.txt
echo "${{ github.sha }}" > version_githash.txt
ls -ltr
@@ -58,9 +55,9 @@ jobs:
platforms: linux/amd64,linux/aarch64
push: true
tags: |
${{ env.REGISTRY_LOWER }}/${{ env.REPOSITORY_LOWER }}:${{ env.CLEAN_BRANCH_NAME }}
${{ env.REGISTRY_LOWER }}/${{ env.REPOSITORY_LOWER }}:pr-${{ env.PR_NUMBER }}
labels: |
branch=${{ env.CLEAN_BRANCH_NAME }}
pr=${{ env.PR_NUMBER }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1.4.4