chore: publish workflow only on master, CI for the PRs

This commit is contained in:
Baptiste Boulongne
2026-08-13 00:40:03 +02:00
parent 2a9d9fa157
commit c6a306897c
2 changed files with 66 additions and 8 deletions
+64
View File
@@ -0,0 +1,64 @@
name: CI
on:
pull_request:
paths:
- "Dockerfile"
- "docker/**"
- ".github/workflows/ci.yml"
- ".github/workflows/publish.yml"
permissions:
contents: read
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
include:
- tag: playerbots
build_playerbots: "ON"
- tag: no-bots
build_playerbots: "OFF"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ matrix.tag }}
type=sha,prefix=${{ matrix.tag }}-
- name: Build
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_PLAYERBOTS=${{ matrix.build_playerbots }}
USE_EXTRACTORS=OFF
SOURCE_REPO=https://github.com/Shyalya/tortoise-wow.git
SOURCE_REF=playerbots-integration-gh
CMAKE_BUILD_TYPE=Release
CMAKE_INSTALL_PREFIX=/opt/turtle
cache-from: type=gha,scope=${{ matrix.tag }}
cache-to: type=gha,mode=max,scope=${{ matrix.tag }}
provenance: false
+2 -8
View File
@@ -6,11 +6,6 @@ on:
paths-ignore:
- "**.md"
- ".env.example"
pull_request:
paths:
- "Dockerfile"
- "docker/**"
- ".github/workflows/publish.yml"
schedule:
# 00:00 UTC
- cron: "0 0 * * *"
@@ -52,7 +47,6 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
@@ -67,14 +61,14 @@ jobs:
tags: |
type=raw,value=${{ matrix.tag }}
type=sha,prefix=${{ matrix.tag }}-
type=raw,value=latest,enable=${{ matrix.is_latest && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
type=raw,value=latest,enable=${{ matrix.is_latest && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |