Restrict when dev container workflow runs #12
Workflow file for this run
This file contains hidden or 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: Dev Containers | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: ["main"] | |
| paths: | |
| - ".devcontainer/**" | |
| - ".github/workflows/devcontainer.yml" | |
| schedule: | |
| - cron: "0 0 * * 0" # Run weekly on Sunday at midnight UTC | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build dev containers | |
| run: | | |
| set -e | |
| find .devcontainer -name 'devcontainer.json' -type f | while IFS= read -r file; do | |
| echo "Building devcontainer for workspace folder: $(dirname "$file")" | |
| npx @devcontainers/cli@latest build --workspace-folder "$(dirname "$file")" --config "$file" | |
| done |