mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
ci: trigger on manual dispatch, tags, and merged PRs
This commit is contained in:
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user