diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 84c62d1..5ae5ed4 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -1,29 +1,42 @@ name: CD on: - push: - branches: - - main - - develop - - feature/** - - release/** - - hotfix/** - paths: - - 'src/**' - - 'ES.FX.sln' - - 'Directory.Build.props' + workflow_run: + workflows: ["CI"] + types: + - completed jobs: deploy: - needs: build-and-test + runs-on: ubuntu-latest - + if: > + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.event == 'push' && + (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 uses: actions/checkout@v4 with: fetch-depth: 0 + - name: src - identify source changes + id: source-changed-filter + uses: dorny/paths-filter@v2 + with: + base: ${{ github.ref }} + filters: | + src: + - 'src/**' + solution: + - 'ES.FX.sln' + build: + - 'Directory.Build.props' + - name: build uses: ./.github/actions/build with: