From 82c3ac4ce7034ad700fb011523bb79cea0f0042e Mon Sep 17 00:00:00 2001 From: Seb-sti1 <65665540+seb-sti1@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:31:50 +0200 Subject: [PATCH] Update doc/main pipeline, fix styleguide, - Change pipeline to build documentation every time but publish only for dev's push - Main pipeline execute every time - Fix styleguide path --- .github/workflows/documentation.yml | 43 +++++++++++++++++------------ .github/workflows/main.yml | 7 ++++- frontend/styleguide.config.js | 10 ++++++- 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 14499010..0d969939 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -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: @@ -40,7 +42,6 @@ jobs: name: backend-documentation path: backend/documentation/ retention-days: 1 - frontend: name: Build frontend documentation runs-on: ubuntu-latest @@ -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 @@ -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 \ No newline at end of file + id: deployment + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77acae4e..966809e6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: diff --git a/frontend/styleguide.config.js b/frontend/styleguide.config.js index d241bd32..f0ef2789 100644 --- a/frontend/styleguide.config.js +++ b/frontend/styleguide.config.js @@ -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}', + ], };