Skip to content

CI: only build Willow when needed #3

CI: only build Willow when needed

CI: only build Willow when needed #3

Workflow file for this run

---
name: meta
env:
GH_TOKEN: ${{ github.token }}
on:
pull_request:
push:
jobs:
trigger_workflow:
name: trigger workflow based on changed files
runs-on: ubuntu-22.04
outputs:
container_any_changed: ${{ steps.changed_files_yaml.outputs.container_any_changed }}
image_any_changed: ${{ steps.changed_files_yaml.outputs.image_any_changed }}
steps:
- uses: actions/checkout@v3
with:
# fetch full history to be able to gather changed files in all new commits
fetch-depth: 0
- uses: tj-actions/changed-files@v37
id: changed_files_yaml
with:
files_yaml: |
container:
- '.github/workflows/build-container.yml'
- 'Dockerfile'
- 'container.gitconfig'
- 'utils.sh'
image:
- 'CMakeLists.txt'
- 'main/**'
- 'partitions_willow.csv'
- 'sdkconfig.willow'
- 'spiffs/**'
build_container:
if: ${{ needs.trigger_workflow.outputs.container_any_changed == 'true' }}
uses: ./.github/workflows/build-container.yml
needs: trigger_workflow
build_willow:
if: ${{ needs.trigger_workflow.outputs.container_any_changed == 'false' && needs.trigger_workflow.outputs.image_any_changed == 'true' }}
uses: ./.github/workflows/build-willow.yml
needs: trigger_workflow
with:
container-image: ghcr.io/toverainc/willow:main