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

Add template #1

Merged
merged 10 commits into from
Apr 11, 2024
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
45 changes: 45 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "Editor Environment",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",

// Features to add to the dev container. More info: https://containers.dev/features.
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000],
"portsAttributes": {
"8000": {
"label": "Documentation Preview"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},

// Use 'postCreateCommand' to run commands after the container is created.
//"postCreateCommand": "pip3 install --user -r requirements.txt",
"postCreateCommand": [
".devcontainer/install-deps.bash",
"mkdir -p $HOME/.config/vscode-dev-containers/ && touch $HOME/.config/vscode-dev-containers/first-run-notice-already-displayed"
],

// Ensure the postCreateCommand is run before accessing the container.
"waitFor": "postCreateCommand",

"customizations": {
"vscode": {
"extensions": [
"samuelcolvin.jinjahtml",
"DavidAnson.vscode-markdownlint",
"arsprogramma.compliment",
"TakumiI.markdowntable",
"redhat.vscode-yaml",
"GitHub.vscode-pull-request-github",
"jebbs.markdown-extended",
"Gruntfuggly.triggertaskonsave"
],
"settings": {
"extensions.ignoreRecommendations": true
}
}
}
}
5 changes: 5 additions & 0 deletions .devcontainer/install-deps.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
sudo apt-get update
sudo apt-get install -y aspell
pip3 install --user -r requirements.txt
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Bug in framework, formatting, deployment etc.
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Link to page displaying bug**
And where in page to look, (If applicable)

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Browser**
e.g. firefox, safari. Screen, if relevant (e.g. mobile, widescreen).
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/content-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Content Request
about: 'Request documentation on a specific subject '
title: ''
labels: content request
assignees: ''

---

**Describe the documentation you'd like**
A clear and concise description of what it should contain.

**Justification**
Why this documentation is needed, and why support.nesi is the best place for this content.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/errata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Errata
about: Incorrect or out of date information in the content of the documentation.
title: ''
labels: errata
assignees: ''

---

**Link to the page containing the erratum**
And where in the page it can be found.

**What the mistake is**
What do you believe it should be.
Supporting evidence (if applicable)
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature Request
about: Suggest an idea for this project
title: ''
labels: feature request
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
30 changes: 30 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# CI

Description of current CI workflow.

## [fetch_includes.yml](fetch_includes.yml)

Retreives dynamically generated content from external sources.

Currently retreives:
- Software module list from [modules-list](https://github.com/nesi/modules-list).
- Glossary, spellcheck dictionary and snippets from [nesi-wordlist](https://github.com/nesi/nesi-wordlist)

All modified files are added to a new branch called `new-assets` and merged into main.

In theory, all this could be done at deployment, but I wanted to make sure that changes to these remote files didn't break anything.

## [checks.yml](checks.yml)

A series of QA checks run on the documentation.

The checks can be started manually from the ![workflow page](https://github.com/nesi/agdr-docs-concept/actions/workflows/checks.yml/badge.svg),
select the target branch, give the pattern of files to include, and select which checks you want done.

Checks will also be run on any _non main_ branch pushes. All checks will be run, but only on _changed_ files.

More info on what these checks do in [README.md](../../checks/README.md)

## [deploy.yml](deploy.yml)

Runs on push to _main_ branch. Builds and deploys pages.
144 changes: 144 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Checks
env:
MODULE_LIST_PATH: docs/assets/module-list.json
on:
push:
workflow_dispatch:
inputs:
fileList:
description: Files to Lint (space delimited). Use `docs/**/*.md` to lint all.
required: true
default: "docs/CONTRIBUTING.md"
type: string
checkSpelling:
description: Check Spelling
default: true
type: boolean
checkProse:
description: Check Prose
default: true
type: boolean
checkMarkdown:
description: Check Markdown
default: true
type: boolean
checkMeta:
description: Check Meta
default: true
type: boolean
testBuild:
description: Test Build
default: true
type: boolean
jobs:
get:
name: Determine what files to check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: get-changed-files
uses: tj-actions/changed-files@v40
with:
files: |
docs/**/*.md
- name: Push Changed files to output
if: inputs.fileList == ''
id: diff
run: |
echo "Changed files: ${{steps.get-changed-files.outputs.all_changed_files}}"
echo "filelist=${{steps.get-changed-files.outputs.all_changed_files}}" >> $GITHUB_OUTPUT
outputs:
filelist: ${{steps.diff.outputs.filelist || inputs.fileList}}
spellcheck:
name: Check Spelling
if: ${{ github.event_name != 'workflow_dispatch' || inputs.checkSpelling }}
runs-on: ubuntu-latest
needs: get
steps:
- if: ${{! needs.get.outputs.filelist}}
name: No files to spellcheck
run: exit 0
- if: ${{needs.get.outputs.filelist}}
name: Check out repo.
uses: actions/checkout@v4
- if: ${{needs.get.outputs.filelist}}
name: Install dependencies
run: |
sudo apt install -y aspell
pip install pyspelling flashtext
- if: ${{needs.get.outputs.filelist}}
name: Run pyspelling
run: |
shopt -s globstar extglob
python3 checks/run_pyspelling.py ${{needs.get.outputs.filelist}}
proselint:
name: Check Prose
if: ${{github.event_name != 'workflow_dispatch'|| inputs.checkProse}}
runs-on: ubuntu-latest
needs: get
steps:
- if: ${{! needs.get.outputs.filelist}}
name: No files to proselint
run: exit 0
- if: ${{needs.get.outputs.filelist}}
name: Check out repo.
uses: actions/checkout@v4
- if: ${{needs.get.outputs.filelist}}
name: Install dependencies
run: pip install proselint
- if: ${{needs.get.outputs.filelist}}
name: Run proselint
run: |
shopt -s globstar extglob
python3 checks/run_proselint.py ${{needs.get.outputs.filelist}}
mdlint:
name: Check Markdown
if: ${{github.event_name != 'workflow_dispatch' || inputs.checkMarkdown}}
runs-on: ubuntu-latest
needs: get
steps:
- if: ${{! needs.get.outputs.filelist}}
name: No files to check Markdown
run: exit 0
- if: ${{needs.get.outputs.filelist}}
name: Check out repo.
uses: actions/checkout@v4
- if: ${{needs.get.outputs.filelist}}
name: Install dependencies
run: npm install -g markdownlint-cli
- if: ${{needs.get.outputs.filelist}}
name: Run markdownlint
run: |
shopt -s globstar extglob
markdownlint --config .markdownlint.json --json ${{needs.get.outputs.filelist}} 2>&1 | checks/parse_markdownlint.py
metacheck:
name: Check page meta
if: ${{github.event_name != 'workflow_dispatch'|| inputs.checkMeta}}
runs-on: ubuntu-latest
needs: get
steps:
- if: ${{ ! needs.get.outputs.filelist}}
name: No files to check meta on.
run: exit 0
- if: ${{needs.get.outputs.filelist}}
name: Check out repo.
uses: actions/checkout@v4
- if: ${{needs.get.outputs.filelist}}
name: Check markdown meta.
run: |
shopt -s globstar extglob
python3 checks/run_meta_check.py ${{needs.get.outputs.filelist}}
testBuild:
name: Test build
if: ${{github.event_name != 'workflow_dispatch' || inputs.testBuild}}
runs-on: ubuntu-latest
needs: get
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: pip install -r requirements.txt
- run: mkdocs build --strict 2>&1 | awk -F " - " '{gsub(/ /, "", $1);gsub(/INFO/, "notice", $1); printf("::%s::%s\n",$1,$2) }'
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to gh-pages
on:
push:
branches: main
workflow_dispatch:
inputs:
dry-run:
type: boolean
description: Dry run (will build to 'gh-pages-test')
default: false
permissions:
contents: write
env:
INPUTS_DRYRUN: ${{ inputs.dry-run }}
MODULE_LIST_PATH: docs/assets/module-list.json
jobs:
deploy:
runs-on: ubuntu-latest
# if: ( ${{ github.event_name }} == 'workflow_dispatch' || ${{ github.event.workflow_run.conclusion == 'success' }} )
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: mkdocs gh-deploy --verbose --force
42 changes: 42 additions & 0 deletions .github/workflows/fetch_includes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Fetch Remote Assets
on: workflow_dispatch
# permissions:
# contents: write
env:
MODULES_LIST_URL: "https://raw.githubusercontent.com/nesi/modules-list/main/module-list.json"
GLOSSARY_URL: "https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/glossary.md"
DICTIONARY_URL: "https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/dictionary.txt"
SNIPPETS_URL: "https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/snippets.md"
BRANCH_NAME: "new-assets"
jobs:
fetch-includes:
runs-on: ubuntu-latest
steps:
- name: "Set Up Env"
uses: actions/checkout@v4
- run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git checkout -b ${BRANCH_NAME}
mkdir -pv docs/assets/glossary
- name: Fetch Module List
run: wget -O docs/assets/module-list.json ${MODULES_LIST_URL}
- name: Link apps pages
run: python3 .github/workflows/link_apps_pages.py
- name: Fetch Glossary
run: wget -O overrides/partials/glossary.html ${GLOSSARY_URL}
- name: Fetch Dictionary
run: wget -O docs/assets/glossary/dictionary.txt ${DICTIONARY_URL}
- name: Fetch Snippets
run: wget -O docs/assets/glossary/snippets.md ${SNIPPETS_URL}
- name: Commit to Branch '${BRANCH_NAME}'
run: |
git pull origin main
git add --all
- run: git commit -m "update remote assets"
- name: Push, and make PR
run: |
git push origin ${BRANCH_NAME}
gh pr create -B main -H ${BRANCH_NAME} --title 'Update Remote Assets' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from_zendesk/cache/**
from_zendesk/import_worktree/**
public/*
production/*
**.pyc
.venv/**
.ipynb_checkpoints
dictionary.dic
Loading
Loading