Skip to content

Commit

Permalink
trying to get the docs to build
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Jun 24, 2024
1 parent 7160a0a commit 2de8ab4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# Clone and set up the old gh-pages branch
- name: Clone old gh-pages
if: ${{ github.event_name == 'push' }}
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch'}}
run: |
set -x
git fetch
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
# _gh-pages/branch/$brname (transforming '/' into '--')
- name: Build and copy documentation (branch)
if: |
contains(github.event_name, 'push') &&
(contains(github.event_name, 'push') || contains(github.event_name, 'workflow_dispatch')) &&
!contains(github.ref, env.DEFAULT_BRANCH)
run: |
set -x
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/pr_documentation_link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Add Documentation Link to PR

on:
workflow_dispatch:
pull_request:
types: [opened]

jobs:
add-doc-link:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Add Documentation Link
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=${{ github.event.number }}
BRANCH_NAME=${{ github.event.pull_request.head.ref }}
DOCS_URL="https://ncar.github.io/micm/branch/${BRANCH_NAME}"
# Comment body
COMMENT_BODY="Here is the documentation for this branch: [${BRANCH_NAME} Documentation](${DOCS_URL})"
# Post the comment
curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
-X POST \
-d "{\"body\": \"${COMMENT_BODY}\"}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"

0 comments on commit 2de8ab4

Please sign in to comment.