Merge pull request #455 from raft-tech/devops/2457-ci-path-filtering #10
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
########################################################################### | |
# GitHub Action Workflow | |
# On pull request or changes to scripts/commands or changes to the pipeline | |
# code to any branch besides develop, staging and master triggers the full | |
# build and test pipeline. | |
# | |
# NOTE: develop, staging(main) and master are skipped on the push because this | |
# would be redundant after running the full set of tests from the PR. | |
# See deploy-develop-on-merge.yml and make_erd for the workflow | |
# pipelines that run on merge to develop, staging, and master branches. | |
# | |
# Step 0: make PR from your branch into develop, or make changes on your | |
# branch to non-documentation files in scripts or commands.sh and | |
# push changes to your remote branch. | |
# | |
# Step 1: Makes a request to the V2 CircleCI API to initiate the project, | |
# which will filter based upon build_and_test_backend and | |
# build_and_test_frontend to run the workflow/jobs listed here: | |
# build-and-test:[ | |
# test-backend, | |
# test-frontend, | |
# test-e2e | |
# ] | |
# | |
# Leverages the open source GitHub Action: | |
# https://github.com/promiseofcake/circleci-trigger-action | |
########################################################################### | |
name: Build and test All for PRs and when scripts/commands change | |
on: | |
push: | |
branches_ignore: | |
- develop | |
- main | |
- master | |
paths: | |
- 'scripts/**' | |
- 'commands.sh' | |
- '.circleci/**' | |
- '.github/**' | |
paths_ignore: | |
- '**.md' | |
pull_request: | |
branches_ignore: #handled in circleci | |
- main | |
- master | |
types: [review_requested, ready_for_review] | |
paths_ignore: | |
- 'docs/**' | |
- '**.md' | |
- '**.txt' | |
- '.gitattributes' | |
- '.gitignore' | |
- 'LICENSE' | |
jobs: | |
build_and_test_all: | |
runs-on: ubuntu-latest | |
name: Initiate deploy job in CircleCI | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Circle CI Deployment Trigger | |
id: curl-circle-ci | |
uses: promiseofcake/circleci-trigger-action@v1 | |
with: | |
user-token: ${{ secrets.CIRCLE_CI_V2_TOKEN }} | |
project-slug: ${{ github.repository }} | |
branch: ${{ github.ref }} | |
payload: '{"build_and_test_all": true}' |