Skip to content

Merge pull request #274 from RMoodsTeam/211-refactor-front-end-structure #190

Merge pull request #274 from RMoodsTeam/211-refactor-front-end-structure

Merge pull request #274 from RMoodsTeam/211-refactor-front-end-structure #190

Workflow file for this run

name: Deploy static content to Pages
on:
push:
branches: ["dev"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.5.1
- name: Create temp deploy folder
run: mkdir deploy
- name: Copy docs to deploy folder
run: cp -r docs/ deploy/
## BEGIN BACKEND ###
- name: Build Backend API Docs
working-directory: backend
run: cargo doc --document-private-items --no-deps
- name: Fix permissions
working-directory: backend
run: |
chmod -c -R +rX "target/doc/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Copy Backend API Docs into the docs dir
working-directory: backend
run: |
mv target/doc target/backend
cp -r target/backend ../deploy/docs
### END BACKEND ###
### BEGIN NLP ###
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: 'pip'
- name: Install NLP dependencies
working-directory: nlp
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Make the sphinx docs
working-directory: nlp/docs
run: |
make clean
make html
- name: Copy NLP documentation to docs directory
working-directory: nlp
run: cp -r docs/_build/html ../deploy/docs/nlp
## END NLP ###
### BEGIN FRONTEND ###
- name: Build Frontend API Docs
working-directory: frontend
run: npm ci && npm run build-docs && npm run build
- name: Copy Frontend API Docs into the docs dir
working-directory: frontend
run: cp -r ./docs/ ../deploy/docs/frontend
- name: Copy Frontend to root directory
working-directory: frontend
run: cp -r ./dist/* ../deploy
### END FRONTEND ###
- name: Upload frontend
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: './deploy'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4