Fixes for Omada template + build mode improvement #75
Workflow file for this run
This file contains 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: Build Trigger | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- closed | |
branches: | |
- main | |
paths: | |
- ".github/workflows/trigger.yml" | |
- "./templates/*" | |
schedule: | |
- cron: "0 0 */7 * *" | |
workflow_dispatch: | |
jobs: | |
init: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: List changed templates | |
id: all-changed-templates-list | |
uses: tj-actions/changed-files@v45 | |
with: | |
files: templates/** | |
if: ${{github.event_name}} == 'pull_request' | |
- name: List all templates | |
id: all-templates-list | |
run: | | |
sudo apt-get install -y jq | |
echo all_files="$(printf '%s' "$(ls templates/*)" | jq -Rsc 'split("\n")')" | tee -a $GITHUB_OUTPUT | |
echo all_changed_files=$(echo -n ${{ steps.all-changed-templates-list.outputs.all_changed_files }} | jq -Rsc 'split(" ")') | tee -a $GITHUB_OUTPUT | |
if: ${{github.event_name}} != 'pull_request' | |
- name: Check templates list | |
id: check-templates-list | |
run: | | |
echo all_files=${{ steps.all-templates-list.outputs.all_files }} | |
echo all_changed_files=${{ steps.all-templates-list.outputs.all_changed_files }} | |
echo TEMPLATES_LIST=${{ steps.all-templates-list.outputs.all_changed_files != '[]' && steps.all-templates-list.outputs.all_changed_files || steps.all-templates-list.outputs.all_files }} | tee -a $GITHUB_OUTPUT | |
outputs: | |
templates_list: ${{steps.check-templates-list.outputs.TEMPLATES_LIST}} | |
image-build: | |
needs: init | |
strategy: | |
fail-fast: false | |
matrix: | |
templates: ${{ fromJson(needs.init.outputs.templates_list) }} | |
uses: ./.github/workflows/builder.yml | |
with: | |
config_path: ${{matrix.templates}} | |
branch_name: ${{github.event.pull_request.base.ref}} | |
is_merged: ${{github.event.pull_request.merged || github.event_name == 'schedule'}} | |
secrets: inherit |