Skip to content

Commit 103f102

Browse files
committed
build(deployment): configure CI workflows
Reference: - #3 Signed-off-by: Akshay Mestry <[email protected]>
1 parent d0fabef commit 103f102

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed

.github/workflows/deployment.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# TOPSTSCHOOL Sphinx (Documentation) Deployment Workflow
2+
# ======================================================
3+
#
4+
# Author: Akshay Mestry <[email protected]>
5+
# Created on: Sunday, October 27 2024
6+
# Last updated on: Sunday, October 27 2024
7+
8+
name: deployment
9+
run-name: Auto-started ${{ github.workflow }} after linting
10+
11+
on:
12+
workflow_run:
13+
workflows: [linting]
14+
types: [completed]
15+
branches: [$default-branch]
16+
17+
permissions:
18+
contents: write
19+
20+
env:
21+
ARTIFACTNAME: topstschool-pages
22+
BUILDDIR: docs/build/
23+
SOURCEDIR: docs/source
24+
PYTHONVERSION: 3.12.1
25+
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.ref }}
28+
cancel-in-progress: true
29+
30+
jobs:
31+
build:
32+
name: build
33+
runs-on: ubuntu-latest
34+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
38+
with:
39+
fetch-depth: 1
40+
- name: Setup
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: ${{ env.PYTHONVERSION }}
44+
cache: pip
45+
- name: Build pages with Sphinx
46+
id: build
47+
run: |
48+
echo "Clean installing latest version of sphinx and other runtime dependencies..."
49+
python -m pip install -Uq pip -rrequirements.txt
50+
echo "Building documentation pages..."
51+
sphinx-build -EWqa --builder html ${{ env.SOURCEDIR }} ${{ env.BUILDDIR }}
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v3
54+
with:
55+
name: ${{ env.ARTIFACTNAME }}
56+
path: ${{ env.BUILDDIR }}
57+
deploy:
58+
name: deploy
59+
needs: build
60+
permissions:
61+
contents: read
62+
pages: write
63+
id-token: write
64+
environment:
65+
name: canary
66+
url: ${{ steps.deployment.outputs.page_url }}
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4
72+
with:
73+
artifact_name: ${{ env.ARTIFACTNAME }}

.github/workflows/linting.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# TOPSTSCHOOL Sphinx (Documentation) Document & Code Linting Workflow
2+
# ==================================================================
3+
#
4+
# Author: Akshay Mestry <[email protected]>
5+
# Created on: Sunday, October 27 2024
6+
# Last updated on: Sunday, October 27 2024
7+
8+
name: linting
9+
run-name: Linting initiated after ${{ github.actor }}'s actions
10+
11+
on:
12+
pull_request:
13+
paths:
14+
- 'docs/**'
15+
- 'requirements*'
16+
paths-ignore:
17+
- .github/
18+
- .gitignore
19+
- README.rst
20+
- LICENSE
21+
22+
permissions:
23+
contents: read
24+
25+
env:
26+
SOURCEDIR: docs/source
27+
PYTHONVERSION: 3.12.1
28+
29+
concurrency:
30+
group: ${{ github.workflow }}-${{ github.ref }}
31+
cancel-in-progress: true
32+
33+
jobs:
34+
lint:
35+
name: linting
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
40+
- name: Setup
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: ${{ env.PYTHONVERSION }}
44+
cache: pip
45+
- name: Analyze
46+
id: linting
47+
run: |
48+
python -m pip install -Uq pip -rrequirements-dev.txt
49+
echo "Checking code for issues..."
50+
flake8 "$_" && sphinx-lint "$_"

0 commit comments

Comments
 (0)