corso/.github/workflows/_filechange_checker.yml
Abin Simon a5ad6e6788
Rework CI to handle combined website and docs (#1568)
## Description

This reworks CI now that we have merged docs and website into a single deployment.

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 💻 CI/Deployment
- [ ] 🐹 Trivial/Minor

## Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* Fixes https://github.com/alcionai/corso/issues/1551

## Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
2022-12-01 16:50:04 +00:00

52 lines
1.9 KiB
YAML

name: Filechange Checker
on:
workflow_call:
outputs:
srcfileschanged:
description: "'true' if src/** or .github/workflows/** files have changed in the branch"
value: ${{ jobs.file-change-check.outputs.srcfileschanged }}
websitefileschanged:
description: "'true' if websites/** or .github/workflows/** files have changed in the branch"
value: ${{ jobs.file-change-check.outputs.websitefileschanged }}
jobs:
file-change-check:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
srcfileschanged: ${{ steps.srcchecker.outputs.srcfileschanged }}
websitefileschanged: ${{ steps.websitechecker.outputs.websitefileschanged }}
steps:
- uses: actions/checkout@v3
# only run CI tests if the src folder or workflow actions have changed
- name: Check for file changes in src/ or .github/workflows/
uses: dorny/paths-filter@v2
id: dornycheck
with:
list-files: json
filters: |
src:
- 'src/**'
website:
- 'website/**'
actions:
- '.github/workflows/**'
- '.github/actions/**'
- name: Check dorny for changes in src filepaths
id: srcchecker
if: steps.dornycheck.outputs.src == 'true' || steps.dornycheck.outputs.actions == 'true'
run: |
echo "src or workflow file changes occurred"
echo ::set-output name=srcfileschanged::true
- name: Check dorny for changes in website related filepaths
id: websitechecker
if: steps.dornycheck.outputs.src == 'true' || steps.dornycheck.outputs.website == 'true' || steps.dornycheck.outputs.actions == 'true'
run: |
echo "website or workflow file changes occurred"
echo ::set-output name=websitefileschanged::true