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

chore: Add documentation #58

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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: 65 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Docs Site

on:
push:
branches:
- main
pull_request:
release:
types: [released]
jobs:

build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Docs Deploy
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "noreply@github.com"

- name: Fetch all tags
run: git fetch --tags

- name: Get the latest tag
id: get_latest_tag
run: |
latest_tag=$(git tag -l | sort -V | tail -n 1)
echo "latest tag: $latest_tag"
echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV

- name: Install docs dependencies
working-directory: doc-site
run: pip install -r requirements.txt

- name: print latest tag
run: echo ${{ env.LATEST_TAG }}

- name: print action
run: echo ${{ github.event.action }}

- name: Update doc site for release
if: github.event.action == 'released' && github.ref_name == env.LATEST_TAG
working-directory: doc-site
run: mike deploy ${{ github.event.release.tag_name }} --push

- name: Update doc site for latest release
if: github.event.action == 'released' && github.ref_name == env.LATEST_TAG
working-directory: doc-site
run: mike deploy ${{ github.event.release.tag_name }} latest -u --push

- name: Update doc site for `main` branch
if: ${{ github.event_name == 'push' }}
working-directory: doc-site
run: mike deploy head --push

- name: Test building the doc site but do not deploy it
if: ${{ github.event_name == 'pull_request' }}
working-directory: doc-site
run: mkdocs build
62 changes: 62 additions & 0 deletions doc-site/.github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 🐞 Bug
description: File a bug/issue
title: "bug: "
labels: [bug]
body:
- type: markdown
attributes:
value: |
_The more information you share, the faster we can help you._
Prior to opening the issue, please make sure that you:
- Use English (EN/US) to communicate.
- Search the [open issues](https://github.com/hyperledger-labs/documentation-template/issues) to avoid duplicating the issue.

- type: textarea
id: problem
attributes:
label: What happened?
description: |
Please provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner.
If this matter is security related, please disclose it privately via security@hyperledger.org
validations:
required: true

- type: textarea
id: expected
attributes:
label: What did you expect to happen?
validations:
required: true

- type: textarea
id: repro
attributes:
label: How can we reproduce it (as minimally and precisely as possible)?
validations:
required: true

- type: textarea
id: additional
attributes:
label: Anything else we need to know?

- type: textarea
id: osVersion
attributes:
label: OS version
value: |
<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>
5 changes: 5 additions & 0 deletions doc-site/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Support Request
url: https://discord.gg/hyperledger
about: Support request or question relating to Hyperledger Docs
27 changes: 27 additions & 0 deletions doc-site/.github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Enhancement Tracking Issue
description: Provide supporting details for an enhancement
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
_The more information you share, the faster we can help you._
Prior to opening the issue, please make sure that you:
- Use English (EN/US) to communicate.
- Search the [open issues](https://github.com/hyperledger-labs/documentation-template/issues) to avoid duplicating the issue.

- type: textarea
id: enhancement
attributes:
label: What would you like to be added?
description: |
A clear and concise description of what you want to happen.
validations:
required: true

- type: textarea
id: rationale
attributes:
label: Why is this needed?
validations:
required: true
31 changes: 31 additions & 0 deletions doc-site/.github/ISSUE_TEMPLATE/improve_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Documentation Issue"
description: Issues related to documentation.
title: "docs: "
labels: [documentation]
body:
- type: markdown
attributes:
value: |
_The more information you share, the faster we can help you._
Prior to opening the issue, please make sure that you:
- Use English (EN/US) to communicate.
- Search the [open issues](https://github.com/hyperledger-labs/documentation-template/issues) to avoid duplicating the issue.

- type: textarea
id: current-state
attributes:
label: Current State
description: Describe the current state of the documentation.
placeholder: |
The documentation for the API in this page (url) is missing ...
validations:
required: true
- type: textarea
id: desired-state
attributes:
label: Desired State
description: Describe the desired state the documentation should be in.
placeholder: |
Add here ...
validations:
required: true
36 changes: 36 additions & 0 deletions doc-site/.github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- name: bug
description: Something isn't working
color: b60205
- name: documentation
description: Improvements or additions to documentation
color: 0052cc
- name: duplicate
description: This issue or pull request already exists
color: 9c99a3
- name: enhancement
description: New feature or request
color: 1dbfcf
- name: good first issue
description: Good for newcomers
color: 8141f0
- name: help wanted
description: Extra attention is needed
color: 0ac492
- name: invalid
description: This doesn't seem right
color: e6da05
- name: needs triage
description: New issue that has not yet been looked at
color: 69a6d1
- name: question
description: Further information is requested
color: 8a23b0
- name: wontfix
description: This will not be worked on
color: ccb5ab
- name: stale
description: no commits in last 30 days
color: 382c0d
- name: awaiting response
description: Waiting for user response
color: d1821b
45 changes: 45 additions & 0 deletions doc-site/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!-- Thanks for sending a pull request! -->

## Proposed changes

Please include a summary of the changes here and why we need those changes. And also let us know which issue is fixed.

Fixes # <issue_number_here>

<hr>

## Types of changes

<!-- to mark a point done, place an x in square brackets. eg [x]-->
<!-- - [x] done with this task-->
<!----Please delete options that are not relevant. And in order to tick the check box just but x inside them for example [x] like this----->

- [ ] Bug fix
- [ ] New feature added
- [ ] Documentation Update

<hr>

## Please make sure to follow these points

<!-- to mark a point done, place an x in square brackets. eg [x]-->
<!-- - [x] done with this task-->
<!----Please delete options that are not relevant. And in order to tick the check box just but x inside them for example [x] like this----->

- [ ] I have read the contributing guidelines.
- [ ] I have performed a self-review of my own code or work.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] My changes generates no new warnings.
- [ ] My Pull Request title is in format <code>< issue name ></code> eg <code>Added links in the documentation</code>.
- [ ] I have added tests that prove my fix is effective or that my feature works.

<hr>

## Screenshots (If Applicable)

<hr>


## Other Information

Any message for the reviewer or kick off the discussion by explaining why you considered this particular solution, any alternatives etc.
48 changes: 48 additions & 0 deletions doc-site/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci

on:
push:
# Publish `main` as latest
branches:
- main

# Publish `v1.2.3` tags as releases
tags:
- v*

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all commits/branches
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- name: Install Python dependencies
run: pip install -r ./requirements.txt
- name: Configure git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

- name: Deploy docs
run: |
# Strip git ref prefix from version
echo "${{ github.ref }}"
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && ALIAS=$(echo $VERSION | sed -e 's/^v//')
# If building from main, use latest as ALIAS
[ "$VERSION" == "main" ] && ALIAS=latest
echo $VERSION $ALIAS
mike deploy --push --update-aliases $VERSION $ALIAS
mike set-default latest
21 changes: 21 additions & 0 deletions doc-site/.github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-issue-label: 'stale'
stale-pr-label: 'stale'
close-issue-message: 'This issue was closed because it has been stalled with no activity.'
close-pr-message: 'This PR was closed because it has been stalled with no activity.'
days-before-stale: 30
days-before-close: 7
only-labels: 'awaiting response'
ignore-updates: true
2 changes: 2 additions & 0 deletions doc-site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
venv
Loading
Loading