diff --git a/.github/workflows/deploy-branch-snapshot.yml b/.github/workflows/deploy-branch-snapshot.yml new file mode 100644 index 00000000..fe952e1c --- /dev/null +++ b/.github/workflows/deploy-branch-snapshot.yml @@ -0,0 +1,26 @@ +name: Branch Documentation Snapshot + +permissions: + pages: write + deployments: write + contents: write + +on: + push: + branches: + - main + - develop + + paths: + - 'mkdocs.yml' + - 'docs/**' + - '.github/workflows/deploy-branch-snapshot.yml' + +concurrency: pages + +jobs: + deploy-snapshot: + uses: secure-software-engineering/actions/pages/branch-snapshot-action.yml@develop + with: + latest_branch: develop + version: "maven" \ No newline at end of file diff --git a/.github/workflows/deploy-pr-preview.yml b/.github/workflows/deploy-pr-preview.yml new file mode 100644 index 00000000..34abd376 --- /dev/null +++ b/.github/workflows/deploy-pr-preview.yml @@ -0,0 +1,28 @@ +name: PR Documentation Preview + +permissions: + pages: write + deployments: write + contents: write + pull-requests: write + +on: + pull_request: + types: + - opened + - closed + - synchronize + - reopened + paths: + - 'mkdocs.yml' + - 'docs/**' + - '.github/workflows/deploy-pr-preview.yml' + +concurrency: pages + +jobs: + deploy-preview: + uses: secure-software-engineering/actions/pages/pr-review-action.yml@develop + with: + enable_comment: true + title_prefix: "Boomerang PR Preview: " \ No newline at end of file diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml deleted file mode 100644 index 25806f19..00000000 --- a/.github/workflows/gh-pages.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Deploy Documentation - -on: - push: - branches: - - master - - develop - paths: - - 'mkdocs.yml' - - 'docs/**' - - '.github/worklflows/gh-pages.yml' - pull_request_target: - types: - - opened - - reopened - - synchronize - - closed - paths: - - 'mkdocs.yml' - - 'docs/**' - - '.github/worklflows/gh-pages.yml' - concurrency: pages - - permissions: - pages: write - deployments: write - contents: write - pull-requests: write - - jobs: - manage: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - fetch-tags: true - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.x - - - name: Install Dependencies - run: pip install mike mkdocs-material mkdocs-tooltips git+https://github.com/RedisLabs/mkdocs-include.git git+https://github.com/swissiety/LspLexer4Pygments.git - - # Sanitize head_ref name - - run: echo "DOC_VERSION_NAME=$(echo ${{ github.head_ref }} | sed "s/[^a-zA-Z0-9._-]/_/g" )" >> $GITHUB_ENV - - # on PR events.. - - name: Deploy Doc in Subdirectory - if: startsWith(github.event_name, 'pull_request') - run: mike deploy ${{ env.DOC_VERSION_NAME }}_preview -t "PR Preview ${{ env.DOC_VERSION_NAME }}" --push && mike props ${{ env.DOC_VERSION_NAME }}_preview --set-string hidden=true --push - - - name: Comment Link to Preview - if: startsWith(github.event_name, 'pull_request') && github.event.action != 'closed' - uses: marocchino/sticky-pull-request-comment@v2 - with: - message: | - [Documentation Preview](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ env.DOC_VERSION_NAME }}_preview/). - - # on PR close - delete preview - - name: Delete the Deployed Preview - if: startsWith(github.event_name, 'pull_request') && github.event.action == 'closed' - run: mike delete ${{ env.DOC_VERSION_NAME }}_preview --push - - - name: Deploy to GitHub Pages - if: github.event_name == 'push' && github.base_ref == 'develop' - run: mike deploy develop --push --update-aliases develop latest - - - name: Deploy Doc Version for New Release - if: github.event_name == 'push' && github.base_ref == 'master' - run: mike deploy "$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed "s/[^a-zA-Z0-9._-]/_/g" )" --push \ No newline at end of file