Skip to content

Commit

Permalink
Revert unwanted files
Browse files Browse the repository at this point in the history
  • Loading branch information
KasukabeDefenceForce committed Jan 6, 2025
1 parent 1bd9b6c commit 919ab11
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 117 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/clean-docs.yml

This file was deleted.

75 changes: 20 additions & 55 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ on:
- opened
- reopened
- synchronize
- labeled # requires the `build-docs` label
- ready_for_review
- labeled # requires the `build-docs` label

workflow_dispatch: # manual trigger
workflow_dispatch: # manual trigger

schedule:
- cron: '0 0 * * 0' # run at midnight every Sunday

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
Expand All @@ -34,55 +36,16 @@ env:
CMFGEN_DB_VER: atomic_data_15nov16.tar.gz
DEPLOY_BRANCH: gh-pages # deployed docs branch

defaults:
run:
shell: bash -l {0}

jobs:
check-for-changes:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
outputs:
trigger-check-outcome: ${{ steps.trigger_check.outcome }}
docs-check-outcome: ${{ steps.docs_check.outcome }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'

- name: Checkout pull/${{ github.event.number }}
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
if: github.event_name == 'pull_request_target'

- name: Check for trigger by push event, manual dispatch, build-docs label on a PR
id: trigger_check
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'build-docs')
run: |
echo "Building docs as a test."
exit 0
continue-on-error: true

- name: Check for changes in documentation
run: |
if git diff origin/master..."$(git rev-parse --abbrev-ref HEAD)" --name-only | cat | grep '^docs/' | grep -q .; then
num_files=$(git diff --name-only origin/master...HEAD | grep '^docs/' | wc -l)
echo "Changes found in documentation files: $num_files"
exit 0
else
echo "No changes found in documentation files - will stop running the pipeline."
exit 1
fi
id: docs_check
if: steps.trigger_check.outcome != 'success'
continue-on-error: true

build-docs:
build:
if: github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_target' &&
contains(github.event.pull_request.labels.*.name, 'build-docs'))
runs-on: ubuntu-latest
needs: check-for-changes
if: needs.check-for-changes.outputs.trigger-check-outcome == 'success' || needs.check-for-changes.outputs.docs-check-outcome == 'success'
steps:

- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down Expand Up @@ -121,10 +84,12 @@ jobs:
environment-name: carsus

- name: Install package
shell: bash -l {0}
run: pip install -e .

- name: Build documentation
run: cd docs/ && make html NCORES=auto
shell: bash -l {0}
run: cd docs/; make html

- name: Set destination directory
run: |
Expand Down Expand Up @@ -167,16 +132,16 @@ jobs:
EVENT: ${{ github.event_name }}

- name: Deploy ${{ env.DEST_DIR }}
uses: peaceiris/actions-gh-pages@v4
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: ${{ env.DEPLOY_BRANCH }}
publish_dir: ./docs/_build/html
destination_dir: ${{ env.DEST_DIR }}
keep_files: true
force_orphan: ${{ env.CLEAN_BRANCH }}
user_name: "TARDIS Bot"
user_email: "tardis.sn.bot@gmail.com"
user_name: 'Github Actions'
user_email: '41898282+github-actions[bot]@users.noreply.github.com'

- name: Find comment
uses: peter-evans/find-comment@v1
Expand All @@ -202,13 +167,13 @@ jobs:
[**Click here**](${{ env.URL }}) to see your results.
env:
URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pull/${{ github.event.number }}/index.html
URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pull/${{ github.event.number }}/
if: success() && github.event_name == 'pull_request_target'

- name: Post comment (failure)
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
Expand All @@ -218,7 +183,7 @@ jobs:
Hi, human.
The **`${{ github.workflow }}`** workflow has **failed** :x:
[**Click here**](${{ env.URL }}) to see the build log.
env:
URL: https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}?check_suite_focus=true
Expand Down
1 change: 1 addition & 0 deletions docs/development/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ testing, debugging, the actual state of the code, etc.
notation.rst
units.rst
testing.rst
compare_atomic_files

0 comments on commit 919ab11

Please sign in to comment.