Skip to content

Commit

Permalink
🐛 fix: changed the flow of npm runs
Browse files Browse the repository at this point in the history
  • Loading branch information
felipequentino committed Oct 7, 2024
1 parent aa3b624 commit e33032c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 13 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/docs.yml → .github/workflows/backend-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,11 @@ jobs:
python-version: '3.12'
# Install all dependencies (including pdoc)
- run: pip install -r backend/requirements.txt
# Build your backend documentation into docs/backend/
- run: pdoc -d google backend/ -o ./docs/backend
# Install frontend dependencies
- run: |
cd frontend
npm install
# Build your frontend documentation into frontend/docs/
- run: |
cd frontend
npm run docs
# Build your documentation into docs/
- run: pdoc -d google backend/ -o ./docs
- uses: actions/upload-pages-artifact@v3
with:
path: |
docs/backend
frontend/docs
path: docs/
# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/frontend-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: frontend-website
# Build the documentation whenever there are new commits on main
on:
push:
branches:
- main
# Alternative: only build for tags.
# tags:
# - '*'
# Security: restrict permissions for CI jobs.
permissions:
contents: read
jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
# Install frontend dependencies
- run: |
cd frontend
npm install
# Build your frontend documentation into frontend/docs/
- run: |
cd frontend
npm run docs
- uses: actions/upload-pages-artifact@v3
with:
path: frontend/docs/
# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4

0 comments on commit e33032c

Please sign in to comment.