4. Nightly Build #201
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: 4. Nightly Build | |
| on: | |
| schedule: | |
| - cron: '0 4 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # Needed for the final commit comment | |
| jobs: | |
| ############################################################ | |
| # JOB 1: Find all REL_* branches with recent commits | |
| ############################################################ | |
| find-active-branches: | |
| name: Find Active REL Branches | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| branches: ${{ steps.get-branches.outputs.branches }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: { fetch-depth: 0 } | |
| - id: get-branches | |
| shell: bash | |
| run: | | |
| REMOTE_REL_BRANCHES=$(git branch -r | grep 'origin/REL_' | sed 's/origin\///') | |
| ACTIVE_BRANCHES=() | |
| for branch in $REMOTE_REL_BRANCHES; do | |
| if [ -n "$(git log "origin/$branch" --since="24 hours ago" --oneline)" ]; then | |
| ACTIVE_BRANCHES+=("\"$branch\"") | |
| fi | |
| done | |
| echo "branches=$(IFS=,; echo "[${ACTIVE_BRANCHES[*]}]")" >> $GITHUB_OUTPUT | |
| ############################################################ | |
| # JOB 2: A meta-job that runs the build process for each branch | |
| ############################################################ | |
| build-and-publish: | |
| name: Build for ${{ matrix.branch }} | |
| needs: find-active-branches | |
| if: fromJson(needs.find-active-branches.outputs.branches)[0] != null | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| branch: ${{ fromJson(needs.find-active-branches.outputs.branches) }} | |
| uses: ./.github/workflows/nightly-worker.yml | |
| with: | |
| branch: ${{ matrix.branch }} | |
| secrets: | |
| IA_ACCESS_KEY: ${{ secrets.IA_ACCESS_KEY }} | |
| IA_SECRET_KEY: ${{ secrets.IA_SECRET_KEY }} |