mirror of
https://github.com/kasperfriend/tortoise-docker.git
synced 2026-08-18 18:44:25 +02:00
chore: publish workflow only on master, CI for the PRs
This commit is contained in:
@@ -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
|
||||
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user