Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
Update doc/main pipeline, fix styleguide,
Browse files Browse the repository at this point in the history
- Change pipeline to build documentation every time but publish only for dev's push
- Main pipeline execute every time
- Fix styleguide path
  • Loading branch information
Seb-sti1 committed Sep 18, 2023
1 parent 56c0c64 commit 6996c65
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 19 deletions.
43 changes: 26 additions & 17 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# use Ubuntu 22.04 & Node 18

# Seems like the documentation can not be deployed on pull requests, but only on pushes to main.
# Seems like the documentation can not be deployed for multiple branch, but only on pushes to main.
# See 5 on https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#creating-a-custom-github-actions-workflow-to-publish-your-site

name: Deploy documentations
name: Build, aggregate and deploy documentations

on:
pull_request:
push:
branches:
- dev
- master

jobs:
backend:
Expand Down Expand Up @@ -40,7 +42,6 @@ jobs:
name: backend-documentation
path: backend/documentation/
retention-days: 1

frontend:
name: Build frontend documentation
runs-on: ubuntu-latest
Expand Down Expand Up @@ -70,22 +71,11 @@ jobs:
name: frontend-documentation
path: frontend/styleguide/
retention-days: 1

deploy:
name: Deploy documentation
aggregate:
name: Aggregate documentation
# Set dependency on backend job
needs: [backend, frontend]

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Download a single artifact
Expand All @@ -107,6 +97,25 @@ jobs:
uses: actions/upload-pages-artifact@v2
with:
path: documentation
deploy: # will deploy the website to GitHub Pages only if the push is on the dev branch
name: Deploy documentation
runs-on: ubuntu-latest
needs: [aggregate]

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

if: github.ref == 'refs/heads/dev'

steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2
id: deployment
id: deployment

7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# use Ubuntu 22.04 & Node 18
name: Build & Test

on: [pull_request]
on:
pull_request:
push:
branches:
- dev
- master

jobs:
backend:
Expand Down
10 changes: 9 additions & 1 deletion frontend/styleguide.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
module.exports = {
components: ['src/App.tsx', 'src/components/**/*.{tsx,jsx,js,ts}'],
components: ['src/App.tsx', 'src/Components/**/*.{tsx,jsx,js,ts}'],
ignore: [
'**/__tests__/**',
'**/*.test.{js,jsx,ts,tsx}',
'**/*.spec.{js,jsx,ts,tsx}',
'**/*.d.ts',
'src/Components/**/constants.ts',
'src/Components/**/Hooks/*.{tsx,jsx,js,ts}',
],
};

0 comments on commit 6996c65

Please sign in to comment.