refactor: Add vitepress scan to the audit-ci's allowlist (#1202) #28
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
| # Sample workflow for building and deploying a VitePress site to GitHub Pages | |
| name: Deploy VitePress site to gh-pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: write | |
| 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: | |
| # Build job | |
| deploy-docs: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| DOC_VERSION: v5 # The directory in gh-pages where the documentation would be deployed | |
| DOC_ALIAS: next # Change this to update the alias route. Note: Check the old alias when changing this! | |
| GIT_COMMITTER_NAME: "OpenUI5 Bot" | |
| GIT_COMMITTER_EMAIL: "[email protected]" | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22.20.0 | |
| cache: npm | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Install dependencies | |
| run: npm ci --engine-strict | |
| - name: Fetch gh-pages branch | |
| run: git fetch origin gh-pages --depth=1 | |
| - name: generate CLI doc | |
| working-directory: internal/documentation | |
| run: npm run generate-cli-doc | |
| - name: Build vitepress build | |
| working-directory: internal/documentation | |
| run: | | |
| # The base output | |
| npm run build:vitepress -- --base="/${{ github.event.repository.name }}/${DOC_VERSION}/" | |
| npm run build:assets -- ./dist | |
| # The alias output | |
| npm run build:vitepress -- --base="/${{ github.event.repository.name }}/${DOC_ALIAS}/" --outDir="dist-${DOC_ALIAS}" | |
| npm run build:assets -- ./dist-${DOC_ALIAS} | |
| - name: Download UI5 CLI packages | |
| working-directory: internal/documentation | |
| run: npm run download-packages | |
| - name: Build jsdoc | |
| working-directory: internal/documentation | |
| run: npm run jsdoc-generate-gh-pages | |
| - name: Build Schema | |
| working-directory: internal/documentation | |
| run: npm run schema-generate-gh-pages | |
| - name: Checkout gh-pages | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: gh-pages | |
| path: gh-pages | |
| - name: Copy the additional resources to gh-pages | |
| run: | | |
| # TODO: Skip for now deployment of the schema until we do a Schema Version 5 release | |
| # rm -rf ./gh-pages/schema | |
| # cp -R internal/documentation/schema ./gh-pages/schema/ | |
| rm -rf ./gh-pages/${DOC_VERSION} | |
| rm -rf ./gh-pages/${DOC_ALIAS} | |
| # Main version route | |
| cp -R internal/documentation/dist ./gh-pages/${DOC_VERSION}/ | |
| # Alias route. E.g., next, latest, stable, etc. | |
| # For vitepress must be a copy with different config, not a symlink | |
| cp -R internal/documentation/dist-${DOC_ALIAS} ./gh-pages/${DOC_ALIAS}/ | |
| # Symlink the api docs to avoid duplication | |
| ln -s ../${DOC_VERSION}/api ./gh-pages/${DOC_ALIAS}/api | |
| # TODO: Enable when v5 release is done | |
| # cp internal/documentation/scripts/resources/custom404.html ./gh-pages/404.html | |
| - name: Publish Docs | |
| run: | | |
| cd ./gh-pages | |
| git config --local user.email $GIT_COMMITTER_EMAIL | |
| git config --local user.name $GIT_COMMITTER_NAME | |
| git add . | |
| git commit -m "Updating supplemental resources for ${DOC_VERSION} documentation deployment" | |
| git push |