ci: trigger on manual dispatch, tags, and merged PRs

This commit is contained in:
V1ck3s
2025-12-13 18:28:08 +01:00
parent 8e1f5035e1
commit 5ec4d31e91

View File

@@ -1,10 +1,12 @@
name: CI/CD
on:
workflow_dispatch:
push:
branches: [main, dev]
tags: ['v*']
pull_request:
branches: [main, dev]
types: [closed]
branches: [master]
env:
DOTNET_VERSION: "9.0.x"
@@ -14,6 +16,10 @@ env:
jobs:
build-and-test:
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.merged == true)
steps:
- name: Checkout
@@ -36,7 +42,6 @@ jobs:
docker:
needs: build-and-test
runs-on: ubuntu-latest
if: github.event_name == 'push'
permissions:
contents: read
@@ -64,7 +69,7 @@ jobs:
tags: |
type=ref,event=branch
type=sha,prefix=
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
- name: Build and push
uses: docker/build-push-action@v6