Skip to content

Deploy Branches

Deploy Branches #70

name: Deploy Branches
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
permissions:
contents: read
actions: write
jobs:
get-branches:
runs-on: ubuntu-latest
outputs:
branches: ${{ steps.get-branches.outputs.branches }}
steps:
- uses: actions/checkout@v4
- name: Get branches
id: get-branches
run: |
BRANCHES=$(yq '.Frameworks[][] | select(has("branch")) | .branch' index.yml | jq -R -s -c 'split("\n")[:-1]')
echo "branches=${BRANCHES}" >> $GITHUB_OUTPUT
dispatch:
needs: get-branches
runs-on: ubuntu-latest
strategy:
matrix:
branch: ${{ fromJson(needs.get-branches.outputs.branches) }}
fail-fast: false
steps:
- name: Trigger workflow
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const ref = '${{ matrix.branch }}';
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'scaffoldly.yml',
ref: ref
});
console.log(`Dispatched workflow for branch: ${ref}`);