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 name: CI/CD
on: on:
workflow_dispatch:
push: push:
branches: [main, dev] tags: ['v*']
pull_request: pull_request:
branches: [main, dev] types: [closed]
branches: [master]
env: env:
DOTNET_VERSION: "9.0.x" DOTNET_VERSION: "9.0.x"
@@ -14,6 +16,10 @@ env:
jobs: jobs:
build-and-test: build-and-test:
runs-on: ubuntu-latest 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: steps:
- name: Checkout - name: Checkout
@@ -36,7 +42,6 @@ jobs:
docker: docker:
needs: build-and-test needs: build-and-test
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push'
permissions: permissions:
contents: read contents: read
@@ -64,7 +69,7 @@ jobs:
tags: | tags: |
type=ref,event=branch type=ref,event=branch
type=sha,prefix= 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 - name: Build and push
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6