]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
.github: Move publish docs to new file CreateDocs.yml
authorGeorge Joseph <gjoseph@sangoma.com>
Tue, 27 Jun 2023 14:07:53 +0000 (08:07 -0600)
committerGeorge Joseph <gjoseph@sangoma.com>
Tue, 27 Jun 2023 16:21:47 +0000 (10:21 -0600)
.github/workflows/CreateDocs.yml [new file with mode: 0644]
.github/workflows/NightlyAdmin.yml

diff --git a/.github/workflows/CreateDocs.yml b/.github/workflows/CreateDocs.yml
new file mode 100644 (file)
index 0000000..1882500
--- /dev/null
@@ -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
index 61af7a9ccf98a690b9b9193b3f321707c47a3155..f190671ee8c7317a0e5eddc5fc3c772e7fe513ea 100644 (file)
@@ -26,23 +26,3 @@ jobs:
           days-before-pr-close: -1
           only-labels: triage,feedback-required
 
-  PublishWikiDocs:
-    if: ${{fromJSON(vars.WIKIDOCS_ENABLE) == true}}
-    strategy:
-      fail-fast: false
-      matrix:
-        branch: ${{ fromJSON(vars.WIKIDOC_BRANCHES) }}
-    runs-on: ubuntu-latest
-    steps:
-      - name: PublishWikiDocs
-        uses: asterisk/asterisk-ci-actions/AsteriskPublishDocsComposite@main
-        with:
-          asterisk_repo:     ${{env.ASTERISK_REPO}}
-          base_branch:       ${{matrix.branch}}
-          modules_blacklist: ${{env.MODULES_BLACKLIST}}
-          github_token:      ${{secrets.GITHUB_TOKEN}}
-          publish_docs_repo:   ${{vars.PUBLISH_DOCS_REPO}}
-          publish_docs_branch: ${{vars.PUBLISH_DOCS_BRANCH}}
-          confluence_url:      ${{vars.CONFLUENCE_URL}}
-          confluence_userpass: ${{secrets.CONFLUENCE_USERPASS}}
-          confluence_space:    ${{vars.CONFLUENCE_SPACE}}