Skip to content

Commit

Permalink
Remove pages preview/push stuff; only check docs build.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsrabin committed Oct 3, 2024
1 parent 442f13d commit 76c3238
Showing 1 changed file with 2 additions and 45 deletions.
47 changes: 2 additions & 45 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ jobs:
fi
echo "Done cleaning branches"
build-and-deploy:
test-build:
permissions:
contents: write # for peaceiris/actions-gh-pages to push
pull-requests: write # to comment on pull requests
pages: write
needs: cleanup
if: ${{ always() }}
name: Build and deploy documentation
name: Test building documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -88,46 +88,3 @@ jobs:
- name: Build Sphinx docs
run: |
make BUILDDIR=${PWD}/_build -C doc/ html
- name: Push PR preview
if: |
github.event_name == 'pull_request'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{secrets.GITHUB_TOKEN}}
external_repository: ${{github.triggering_actor}}/ctsm
publish_branch: gh-pages-sidnfueriu
publish_dir: './_build/html'
destination_dir: './branch/${{ github.event.pull_request.head.ref }}/html'
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
- name: Comment about previewing documentation
if: |
github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
const comments = await github.paginate(github.rest.issues.listComments, {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
const havePosted = comments.map(x => x.user.login).some(x => x === "github-actions[bot]");
if (!havePosted) {
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'You can preview documentation at https://escomp.github.io/ctsm/branch/${{ github.event.pull_request.head.ref }}/html/index.html'
})
}
- name: Push new docs
if: ${{ github.event_name == 'push' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{secrets.GITHUB_TOKEN}}
publish_dir: './_build/html'
destination_dir: './versions/master/html'
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'

0 comments on commit 76c3238

Please sign in to comment.