mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
committed by
Asterisk Development Team
parent
6c00e88cf4
commit
c05262600f
117
.github/workflows/CreateDocs.yml
vendored
117
.github/workflows/CreateDocs.yml
vendored
@@ -3,121 +3,24 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
branches:
|
branches:
|
||||||
description: "JSON array of branches: ['18','20'] (no spaces)"
|
description: "JSON array of branches: ['18','20'] (no spaces) or leave blank for all current branches."
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
schedule:
|
schedule:
|
||||||
# Times are UTC
|
# Times are UTC
|
||||||
- cron: '0 04 * * *'
|
- cron: '0 04 * * *'
|
||||||
|
|
||||||
env:
|
|
||||||
ASTERISK_REPO: ${{ github.repository }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
DEFAULT_BRANCHES: ${{ vars.WIKIDOC_BRANCHES }}
|
|
||||||
INPUT_BRANCHES: ${{ inputs.branches }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
CreateDocs:
|
||||||
CreateDocsDebug:
|
if: ${{ ( github.event_name == 'schedule' && fromJSON(vars.WIKIDOCS_ENABLE) ) || github.event_name == 'workflow_dispatch' }}
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
manual_branches: ${{ steps.setup.outputs.manual_branches }}
|
|
||||||
steps:
|
|
||||||
- name: setup
|
|
||||||
run: |
|
|
||||||
MANUAL_BRANCHES="$INPUT_BRANCHES"
|
|
||||||
[ -z "$MANUAL_BRANCHES" ] && MANUAL_BRANCHES="$DEFAULT_BRANCHES" || :
|
|
||||||
echo "manual_branches=${MANUAL_BRANCHES}"
|
|
||||||
echo "manual_branches=${MANUAL_BRANCHES}" >>${GITHUB_OUTPUT}
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
- name: DumpEnvironment
|
|
||||||
uses: asterisk/asterisk-ci-actions/DumpEnvironmentAction@main
|
|
||||||
with:
|
|
||||||
action-inputs: ${{toJSON(inputs)}}
|
|
||||||
action-vars: ${{ toJSON(steps.setup.outputs) }}
|
|
||||||
|
|
||||||
CreateDocsScheduledMatrix:
|
|
||||||
needs: [ CreateDocsDebug ]
|
|
||||||
if: ${{github.event_name == 'schedule' && fromJSON(vars.WIKIDOCS_ENABLE) == true }}
|
|
||||||
continue-on-error: false
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
branch: ${{ fromJSON(vars.WIKIDOC_BRANCHES) }}
|
branch: ${{ fromJSON(inputs.branches || vars.WIKIDOC_BRANCHES) }}
|
||||||
runs-on: ubuntu-latest
|
uses: asterisk/asterisk-ci-actions/.github/workflows/AsteriskCreateDocs.yml@main
|
||||||
steps:
|
with:
|
||||||
- name: CreateDocs for ${{matrix.branch}}
|
asterisk_repo: ${{ github.repository }}
|
||||||
uses: asterisk/asterisk-ci-actions/CreateAsteriskDocsComposite@main
|
base_branch: ${{ matrix.branch }}
|
||||||
with:
|
secrets:
|
||||||
asterisk_repo: ${{env.ASTERISK_REPO}}
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
base_branch: ${{matrix.branch}}
|
|
||||||
docs_dir: docs_dir/${{matrix.branch}}
|
|
||||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
|
|
||||||
CreateDocsScheduled:
|
|
||||||
needs: [ CreateDocsScheduledMatrix ]
|
|
||||||
if: ${{ success() || failure() }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check CreateDocsScheduledMatrix status
|
|
||||||
env:
|
|
||||||
RESULT: ${{needs.CreateDocsScheduledMatrix.result}}
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
case $RESULT in
|
|
||||||
success)
|
|
||||||
echo "::notice::Docs created"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
skipped)
|
|
||||||
echo "::notice::Skipped"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "::error::One or CreateDocs failed ($RESULT)"
|
|
||||||
exit 1
|
|
||||||
esac
|
|
||||||
|
|
||||||
CreateDocsManualMatrix:
|
|
||||||
needs: [ CreateDocsDebug ]
|
|
||||||
if: ${{github.event_name == 'workflow_dispatch'}}
|
|
||||||
continue-on-error: false
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
branch: ${{ fromJSON(vars.WIKIDOC_MANUAL_BRANCHES) }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: CreateDocs for ${{matrix.branch}}
|
|
||||||
uses: asterisk/asterisk-ci-actions/CreateAsteriskDocsComposite@main
|
|
||||||
with:
|
|
||||||
asterisk_repo: ${{env.ASTERISK_REPO}}
|
|
||||||
base_branch: ${{matrix.branch}}
|
|
||||||
docs_dir: docs_dir/${{matrix.branch}}
|
|
||||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
|
|
||||||
CreateDocsManual:
|
|
||||||
needs: [ CreateDocsManualMatrix ]
|
|
||||||
if: ${{ success() || failure() }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check CreateDocsManualMatrix status
|
|
||||||
env:
|
|
||||||
RESULT: ${{needs.CreateDocsManualMatrix.result}}
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
case $RESULT in
|
|
||||||
success)
|
|
||||||
echo "::notice::Docs created"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
skipped)
|
|
||||||
echo "::notice::Skipped"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "::error::One or CreateDocs failed ($RESULT)"
|
|
||||||
exit 1
|
|
||||||
esac
|
|
||||||
|
Reference in New Issue
Block a user