Skip to content

Commit

Permalink
Misc updates to website
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdan committed Nov 13, 2024
1 parent b57867b commit a41d5e7
Show file tree
Hide file tree
Showing 12 changed files with 250 additions and 286 deletions.
8 changes: 8 additions & 0 deletions docs/1_setting_up.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ This will automatically create and move over to a new branch called `dev`. The e

In the source control tab, hit "Publish Branch".

When you see this symbol:

<br>
![Dark Souls Bonfire](../imgs/dark-souls-bonfire.gif "Commit your changes and rest, weary traveller"){ width="50" .center }
<br>

it means that you should commit and push your changes to the repository. They indicate key checkpoints in the workshop.

## Further reading
<div class="grid cards" markdown>

Expand Down
2 changes: 2 additions & 0 deletions docs/4_Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ OK

You can try changing part of the test code to force them to fail, and check the output. Now that the tests have run succesfully, it's time to commit and push the changes.

<br>
![Dark Souls Bonfire](../imgs/dark-souls-bonfire.gif "Commit your changes and rest, weary traveller"){ width="50" .center }
<br>

!!! note

Expand Down
52 changes: 41 additions & 11 deletions docs/CICD/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,61 @@ Here is the workflow for this:
name: documentation
on:
push:
branches:
- main
tags:
- 'v*'

jobs:
build-docs:
needs: tests
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

steps:
# Set up dependencies
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Verify tag is on main
run: |
# Get the branch containing this tag
BRANCH=$(git branch -r --contains ${{ github.ref }} | grep 'main' || true)
# Check if the tag is on main
if [ -z "$BRANCH" ]; then
echo "Error: Tag must be created on main branch"
exit 1
fi
- name: Install Poetry
run: pipx install poetry

- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- run: python3 -m pip install mkdocs==1.4.2 mkdocstrings==0.21.2 "mkdocstrings[python]>=0.18"
python-version: '3.12'
cache: 'poetry'

- name: Install dependencies with dev group
run: poetry install --with dev

# Deploy docs
- name: Deploy documentation
run: mkdocs gh-deploy --force
run: |
poetry run mkdocs gh-deploy --force
```
This simply says: when a push is made to main, publish the documentation.
Most of this is the same as for publishing the package to PyPi. The main difference is that we are running `mkdocs gh-deploy --force` to deploy the documentation to GitHub Pages. This will create a new branch called `gh-pages` which will contain the documentation.

You should now be able to navigate to `https://<username>.github.io/<repo-name>` and see your documentation!

!!! tip

This is a great tool to make personal websites for your work. You can add images, links, and even videos to your documentation. It is a great way to showcase your research.

This website was made using MkDocs and the Material theme! Check out the Material website [here](https://squidfunk.github.io/mkdocs-material/).

For more details on how our websites are made, then you can browse through the folders in the github repo by clicking the GitHub icon at the top left of the page.

In addition, since we are using some tools, we should let everyone know! So we can add the following to our `README.md` file:
In addition, since we are using some tools, we should let everyone know! So we can add the following to our `README.md` file (just be sure to replace the links with the correct ones):
```html
<div align="center">
Expand Down
4 changes: 4 additions & 0 deletions docs/CICD/precommit.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ Found 4 errors in 1 file (checked 7 source files)
isort....................................................................Passed
```

<br>
![Dark Souls Bonfire](../imgs/dark-souls-bonfire.gif "Commit your changes and rest, weary traveller"){ width="50" .center }
<br>

## Further reading
<div class="grid cards" markdown>

Expand Down
Loading

0 comments on commit a41d5e7

Please sign in to comment.