Started website deployment #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SMART Website Deployment Workflow | |
# ================================= | |
# | |
# Author: Akshay Mestry <[email protected]> | |
# Created on: Monday, February 24 2025 | |
# Last updated on: Monday, March 03 2025 | |
name: deployment | |
run-name: Started website ${{ github.workflow }} | |
on: | |
workflow_dispatch: | |
push: | |
permissions: | |
contents: write | |
env: | |
ARTIFACT_NAME: smart-pages | |
BUILD_DIR: docs/build/ | |
PYTHON_VERSION: 3.13.2 | |
DOCSEARCH_APP_ID: ${{ secrets.DOCSEARCH_APP_ID }} | |
DOCSEARCH_API_KEY: ${{ secrets.DOCSEARCH_API_KEY }} | |
DOCSEARCH_INDEX_NAME: ${{ secrets.DOCSEARCH_INDEX_NAME }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 | |
with: | |
fetch-depth: 1 | |
- name: Setup | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Analyse | |
id: linting | |
run: | | |
python -m pip install -Uq pip tox | |
echo "Checking code for issues..." | |
tox -p | |
build: | |
name: build | |
needs: lint | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 | |
with: | |
ref: ${{ github.event.pull_request.merge_commit_sha }} | |
fetch-depth: 1 | |
- name: Setup | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Build pages with Sphinx | |
id: build | |
run: | | |
python -m pip install -Uq -e . | |
echo "Building documentation pages..." | |
cd docs && make html | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: ${{ env.BUILD_DIR }} | |
deploy: | |
name: deploy | |
needs: [lint, build] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: production | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
with: | |
artifact_name: ${{ env.ARTIFACT_NAME }} |