Skip to content

Merge pull request #455 from raft-tech/devops/2457-ci-path-filtering #2

Merge pull request #455 from raft-tech/devops/2457-ci-path-filtering

Merge pull request #455 from raft-tech/devops/2457-ci-path-filtering #2

###########################################################################
# GitHub Action Workflow
# On push changing terraform files or infrastructure pipelines, triggers the
# terraform deploy pipeline for the appropriate cf space.
#
# Step 0: make changes to non-documentation files in terraform/ or
# .circleci/infrastructure/ and push/merge changes.
#
# Step 1: Makes a request to the V2 CircleCI API to initiate the project,
# which will filter based upon terraform: true flag
# to run the workflow/jobs listed here:
# build-and-test:[
# enable-versioning-for-s3-buckets
# ]
#
# Leverages the open source GitHub Action:
# https://github.com/promiseofcake/circleci-trigger-action
###########################################################################
name: Run Infrastructure Pipeline When Terraform or Infrastructure Files Change
on:
push:
branches_ignore: #handled in CircleCI
- main
- master
paths:
- 'terraform/**'
- '.circleci/infrastructure/**'
paths_ignore:
- '**.md'
- '**.txt'
jobs:
run_infrastructure_deployment:
runs-on: ubuntu-latest
name: Deploy Infrastructure
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: '{"deploy_infrastructure": true}'