mirror of https://github.com/asterisk/asterisk
parent
5cc2629bf2
commit
03c83527e5
@ -0,0 +1,109 @@
|
||||
name: CreateDocs
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branches:
|
||||
description: "JSON array of branches: ['18','20'] (no spaces)"
|
||||
required: true
|
||||
type: string
|
||||
schedule:
|
||||
# Times are UTC
|
||||
- cron: '0 04 * * *'
|
||||
|
||||
env:
|
||||
ASTERISK_REPO: ${{ github.repository }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
CreateDocsDebug:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: DumpEnvironment
|
||||
uses: asterisk/asterisk-ci-actions/DumpEnvironmentAction@main
|
||||
with:
|
||||
action-vars: ${{toJSON(inputs)}}
|
||||
|
||||
CreateDocsScheduledMatrix:
|
||||
needs: [ CreateDocsDebug ]
|
||||
if: ${{github.event_name == 'schedule' && fromJSON(vars.WIKIDOCS_ENABLE) == true }}
|
||||
continue-on-error: false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJSON(vars.WIKIDOC_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}}
|
||||
|
||||
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(inputs.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
|
Loading…
Reference in new issue