Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes check-changes and reorders jobs #4459

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 26 additions & 39 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,40 @@ on:
permissions:
contents: read
jobs:
check-changes:
name: Check for changes to documentation
cleanup:
permissions:
contents: write # for git push
name: Cleanup branch previews
runs-on: ubuntu-latest
outputs:
any_changed: ${{ steps.changed-check.outputs.any_changed }}
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: tj-actions/changed-files@v37
id: changed-check
with:
files: doc/**
ref: 'gh-pages'
fetch-depth: 0
lfs: true
path: gh-pages
- name: Remove branch previews
run: |
for name in `ls branch/`
do
if [[ -z "$(git show-ref --quiet ${name})" ]]
then
git rm -rf branch/${name}
fi
done
- name: Commit and push local changes to gh-pages
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git commit -m "Clean up branch previews"
git push
build-and-deploy:
permissions:
contents: write # for peaceiris/actions-gh-pages to push
pull-requests: write # to comment on pull requests
needs: check-changes
if: needs.check-changes.outputs.any_changed == 'true'
needs: cleanup
if: ${{ always() }}
name: Build and deploy documentation
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -104,31 +119,3 @@ jobs:
destination_dir: './versions/master/html'
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
cleanup:
permissions:
contents: write # for git push
needs: build-and-deploy
name: Cleanup branch previews
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
with:
ref: 'gh-pages'
fetch-depth: 0
lfs: true
- name: Remove branch previews
run: |
for name in `ls branch/`
do
if [[ -z "$(git show-ref --quiet ${name})" ]]
then
git rm -rf branch/${name}
fi
done
- name: Commit and push local changes to gh-pages
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git commit -m "Clean up branch previews"
git push
2 changes: 0 additions & 2 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ The Common Infrastructure for Modeling the Earth (CIME - pronounced
Earth system models, data and stub model components, a driver and associated tools
and libraries.

Test

Table of contents
-----------------
.. toctree::
Expand Down
Loading