Skip to content

Commit

Permalink
devops: split pipeline in CI and CD
Browse files Browse the repository at this point in the history
  • Loading branch information
winromulus committed Jun 15, 2024
1 parent c3ea722 commit eb817f4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 40 deletions.
48 changes: 12 additions & 36 deletions .github/workflows/main.yaml → .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,22 @@
name: Main
name: CD

on:
push:
branches:
- '**' # Matches all branches
- main
- develop
- feature/**
- release/**
- hotfix/**
paths:
- 'src/**'
- 'ES.FX.sln'
- 'Directory.Build.props'

jobs:
ci:
name: CI
deploy:
needs: build-and-test
runs-on: ubuntu-latest
steps:

- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: build
uses: ./.github/actions/build
with:
configuration: Debug
useVersioning: false

- name: test
uses: ./.github/actions/test

cd:
name: CD
needs: ci
runs-on: ubuntu-latest
if: >
(
contains(toJson(github.event.commits), 'src/') ||
contains(toJson(github.event.commits), 'ES.FX.sln') ||
contains(toJson(github.event.commits), 'Directory.Build.props')
) && (
github.ref == 'refs/heads/main' ||
github.ref == 'refs/heads/develop' ||
startsWith(github.ref, 'refs/heads/feature/') ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/heads/hotfix/')
)

steps:
- name: checkout
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/pr.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Pull Request
name: CI

on:
push:
branches:
- '**' # Matches all branches
pull_request:

jobs:
ci:
name: CI
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
steps:

Expand All @@ -19,6 +22,6 @@ jobs:
with:
configuration: Debug
useVersioning: false

- name: test
uses: ./.github/actions/test

0 comments on commit eb817f4

Please sign in to comment.