chore: update cancel workflow action #2639
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Default push workflow | |
on: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
init: | |
uses: ./.github/workflows/00-init.yml | |
scan-secrets: | |
if: github.event.pull_request == null || github.event.pull_request.head.repo.owner.login == 'db-ui' | |
uses: ./.github/workflows/00-scan-secrets.yml | |
lint: | |
uses: ./.github/workflows/01-lint.yml | |
needs: [init] | |
test: | |
uses: ./.github/workflows/01-test.yml | |
needs: [init] | |
build: | |
uses: ./.github/workflows/01-build.yml | |
needs: [init] | |
checks-done: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🎉 Checks done | |
run: | | |
resultBuild="${{ needs.build.result }}" | |
resultTest="${{ needs.test.result }}" | |
resultLint="${{ needs.lint.result }}" | |
if [[ $resultBuild == "success" && $resultTest == "success" && $resultLint == "success" ]]; then | |
echo "🎉 All tests & build were successful." | |
exit 0 | |
else | |
echo "Some tests were failing." | |
exit 1 | |
fi | |
needs: [build, test, lint] | |
deploy: | |
uses: ./.github/workflows/02-deploy-gh-pages.yml | |
if: ${{ github.actor != 'dependabot[bot]' && (github.event.pull_request == null || github.event.pull_request.head.repo.owner.login == 'db-ui') }} | |
needs: [lint, test, build] |