Skip to content

Commit

Permalink
Merge pull request #3 from nesi/CallumWalley-patch-1
Browse files Browse the repository at this point in the history
Test PR
  • Loading branch information
CallumWalley authored Sep 27, 2024
2 parents 2129b9f + 0dad978 commit 7cb15e4
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 30 deletions.
47 changes: 26 additions & 21 deletions .github/workflows/demo_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Deploy PR branches
on:
pull_request:
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TARGET_REPO: "mkdocs-demo-deploy"
Expand All @@ -15,35 +16,39 @@ jobs:
name: Trigger test deployments
runs-on: ubuntu-latest
steps:
# - name: Trigger Workflow in Another Repository
# run: |
# set -x
# set -o xtrace
# curl -L \
# -X POST \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer ${{ secrets.PAT }}" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/dispatches \
# -d "{\"event_type\":\"deploy\",\"client_payload\":}"
- name: Run 'deploy.yml' Workflow
uses: convictional/[email protected]
with:
owner: ${TARGET_OWNER}
repo: ${TARGET_REPO}
github_token: ${{ secrets.PAT }}
workflow_file_name: deploy.yml
client_payload: '{"targets":"${GITHUB_REPOSITORY}:${HEAD}", "use-cache":"true"}'
- name: Trigger Workflow in Another Repository
run: |
set -x
set -o xtrace
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/dispatches \
-d "{\"event_type\":\"deploy\",\"client_payload\":{\"targets\":\"${GITHUB_REPOSITORY}:${HEAD}\", \"use-cache\":\"true\"}}"
# This would be better if it worked
# - name: Run 'deploy.yml' Workflow
# uses: convictional/[email protected]
# with:
# owner: ${TARGET_OWNER}
# repo: ${TARGET_REPO}
# github_token: ${{ secrets.PAT }}
# workflow_file_name: deploy.yml
# client_payload: '{\"targets\":\"${GITHUB_REPOSITORY}:${HEAD}\", \"use-cache\":\"true\"}'
# - name: Wait for Workflow Action
# run: |
# # Just give a minute or so to deploy
# # sleep 60
# curl -L \
# -X POST \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer ${{ secrets.PAT }}" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/actions/runs/deploy.yml
- name: Wait for Workflow Action
run: |
# Just give a minute or so to deploy
sleep 60
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
# NeSI docs template

Put some infor about the site here.
Replace this readme with info about the site.

## Contents
## First Time Setup

The repository is organised using the following folders:
You will need to have Python **3.10** or later installed on your computer.

- `checks` : scripts intended to be run by CI,
- `docs`: markdown files, structure determines categories and sections[^1],
- `docs/assets`: non-template related files, e.g. images,
- `overrides`: theme overides or extensions for page templates.
- `overrides/partials`: Overrides and extensions for sub components.
Clone this repository and create a Python virtual environment using:

[^1]: A section or category can be replaced by an `index.md` file, this will replace the default nav with a page.
```sh
git clone https://github.com/nesi/nesi-mkdoc-template.git
cd nesi-mkdoc-template
python -m venv .venv
source .venv/bin/activate
pip3 install pip-tools
pip-compile
pip3 install -r requirements.txt
```

## Build and deploy

```sh
source .venv/bin/activate
mkdocs serve -c
```

Take note of any warnings or errors.

A link to the deployment will be printed once served.

## Developer Documentation

Expand All @@ -35,6 +50,7 @@ Deployments of open pull requests can be viewed at [https://callumwalley.github.

We are using the [mkdocs material theme](https://squidfunk.github.io/mkdocs-material/).


## Analyics

Google Analytics can be set up.

0 comments on commit 7cb15e4

Please sign in to comment.