Skip to content

Commit 1b894e6

Browse files
committed
.github: Move publish docs to new file CreateDocs.yml
1 parent 359f943 commit 1b894e6

File tree

2 files changed

+109
-20
lines changed

2 files changed

+109
-20
lines changed

.github/workflows/CreateDocs.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: CreateDocs
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
branches:
6+
description: "Comma separated list of branches (no spaces)"
7+
required: true
8+
type: string
9+
schedule:
10+
# Times are UTC
11+
- cron: '0 04 * * *'
12+
13+
env:
14+
ASTERISK_REPO: ${{ github.repository }}
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
18+
jobs:
19+
CreateDocsDebug:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: DumpEnvironment
23+
uses: asterisk/asterisk-ci-actions/DumpEnvironmentAction@main
24+
with:
25+
action-vars: ${{toJSON(inputs)}}
26+
27+
CreateDocsScheduledMatrix:
28+
needs: [ CreateDocsDebug ]
29+
if: ${{github.event_name == 'schedule' && fromJSON(vars.WIKIDOCS_ENABLE) == true }}
30+
continue-on-error: false
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
branch: ${{ fromJSON(vars.WIKIDOC_BRANCHES) }}
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: CreateDocs for ${{matrix.branch}}
38+
uses: asterisk/asterisk-ci-actions/CreateAsteriskDocsComposite@main
39+
with:
40+
asterisk_repo: ${{env.ASTERISK_REPO}}
41+
base_branch: ${{matrix.branch}}
42+
docs_dir: docs_dir/${{matrix.branch}}
43+
github_token: ${{secrets.GITHUB_TOKEN}}
44+
45+
CreateDocsScheduled:
46+
needs: [ CreateDocsScheduledMatrix ]
47+
if: ${{ success() || failure() }}
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Check CreateDocsScheduledMatrix status
51+
env:
52+
RESULT: ${{needs.CreateDocsScheduledMatrix.result}}
53+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
run: |
55+
case $RESULT in
56+
success)
57+
echo "::notice::Docs created"
58+
exit 0
59+
;;
60+
skipped)
61+
echo "::notice::Skipped"
62+
exit 1
63+
;;
64+
*)
65+
echo "::error::One or CreateDocs failed ($RESULT)"
66+
exit 1
67+
esac
68+
69+
CreateDocsManualMatrix:
70+
needs: [ CreateDocsDebug ]
71+
if: ${{github.event_name == 'workflow_dispatch'}}
72+
continue-on-error: false
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
branch: ${{ fromJSON(inputs.branches) }}
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: CreateDocs for ${{matrix.branch}}
80+
uses: asterisk/asterisk-ci-actions/CreateAsteriskDocsComposite@main
81+
with:
82+
asterisk_repo: ${{env.ASTERISK_REPO}}
83+
base_branch: ${{matrix.branch}}
84+
docs_dir: docs_dir/${{matrix.branch}}
85+
github_token: ${{secrets.GITHUB_TOKEN}}
86+
87+
CreateDocsManual:
88+
needs: [ CreateDocsManualMatrix ]
89+
if: ${{ success() || failure() }}
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Check CreateDocsManualMatrix status
93+
env:
94+
RESULT: ${{needs.CreateDocsManualMatrix.result}}
95+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
run: |
97+
case $RESULT in
98+
success)
99+
echo "::notice::Docs created"
100+
exit 0
101+
;;
102+
skipped)
103+
echo "::notice::Skipped"
104+
exit 1
105+
;;
106+
*)
107+
echo "::error::One or CreateDocs failed ($RESULT)"
108+
exit 1
109+
esac

.github/workflows/NightlyAdmin.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,3 @@ jobs:
2626
days-before-pr-close: -1
2727
only-labels: triage,feedback-required
2828

29-
PublishWikiDocs:
30-
if: ${{fromJSON(vars.WIKIDOCS_ENABLE) == true}}
31-
strategy:
32-
fail-fast: false
33-
matrix:
34-
branch: ${{ fromJSON(vars.WIKIDOC_BRANCHES) }}
35-
runs-on: ubuntu-latest
36-
steps:
37-
- name: PublishWikiDocs
38-
uses: asterisk/asterisk-ci-actions/AsteriskPublishDocsComposite@main
39-
with:
40-
asterisk_repo: ${{env.ASTERISK_REPO}}
41-
base_branch: ${{matrix.branch}}
42-
modules_blacklist: ${{env.MODULES_BLACKLIST}}
43-
github_token: ${{secrets.GITHUB_TOKEN}}
44-
publish_docs_repo: ${{vars.PUBLISH_DOCS_REPO}}
45-
publish_docs_branch: ${{vars.PUBLISH_DOCS_BRANCH}}
46-
confluence_url: ${{vars.CONFLUENCE_URL}}
47-
confluence_userpass: ${{secrets.CONFLUENCE_USERPASS}}
48-
confluence_space: ${{vars.CONFLUENCE_SPACE}}

0 commit comments

Comments
 (0)