Migrate extralit-frontend from Vue 2 / Nuxt 2 to Vue 3 / Nuxt 4 #347
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
| name: Build Extralit frontend package | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| workflow_call: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - releases/** | |
| paths: | |
| - "extralit-frontend/**" | |
| - ".github/workflows/extralit-frontend.yml" | |
| pull_request: | |
| paths: | |
| - "extralit-frontend/**" | |
| - ".github/workflows/extralit-frontend.yml" | |
| permissions: | |
| contents: read | |
| id-token: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| name: Build extralit-frontend | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: extralit-frontend | |
| steps: | |
| - name: Checkout Code 🛎 | |
| uses: actions/checkout@v4 | |
| - name: Update repo visualizer | |
| uses: githubocto/repo-visualizer@0.7.1 | |
| with: | |
| root_path: "extralit-frontend/" | |
| excluded_paths: "dist,build,node_modules,docs,tests,.swm,assets,.github,package-lock.json,pdm.lock" | |
| excluded_globs: "*.spec.js;**/*.{png,jpg,svg,md};**/!(*.module).ts,**/__pycache__/,**/__mocks__/,LICENSE*,**/.gitignore,**/*.egg-info/,**/.*/" | |
| output_file: "repo-visualizer.svg" | |
| should_push: false | |
| - name: Upload repo visualizer diagram as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: repo-visualizer | |
| path: repo-visualizer.svg | |
| retention-days: 10 | |
| - name: Setup Node.js ⚙️ | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies 📦 | |
| run: | | |
| npm install | |
| - name: Run lint 🧹 | |
| continue-on-error: true | |
| run: | | |
| npm run lint | |
| - name: Run tests with coverage 🧪 | |
| id: run-tests | |
| run: | | |
| npm run test:coverage | |
| - name: Upload frontend test coverage | |
| if: always() | |
| uses: codecov/codecov-action@v5.4.3 | |
| with: | |
| files: ./coverage/lcov.info | |
| flags: frontend | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| - name: Build package 📦 | |
| env: | |
| # Nuxt 4 SPA (ssr:false) ships as static files served at the site root, so build at | |
| # base "/". (The Nuxt 2 "@@baseUrl@@" placeholder breaks Nuxt 4's prerender crawler; | |
| # parameterizable sub-path hosting is a separate follow-up.) | |
| BASE_URL: "/" | |
| run: | | |
| # `nuxi generate` prerenders the SPA shell to .output/public (index.html + _nuxt | |
| # assets); `nuxi build` only emits a Nitro server with no static index.html. | |
| npm run generate | |
| - name: Upload frontend statics as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: extralit-frontend | |
| path: extralit-frontend/.output/public | |
| # build_dev_docker_image: | |
| # name: Build development extralit-frontend docker image | |
| # needs: build | |
| # uses: ./.github/workflows/extralit-frontend.build-push-dev-frontend-docker.yml | |
| # if: | | |
| # !cancelled() && | |
| # github.event_name == 'pull_request' && github.event.pull_request.draft == false | |
| # with: | |
| # image-name: extralit/extralit-frontend-for-dev | |
| # dockerfile: extralit-frontend/dev.frontend.Dockerfile | |
| # platforms: linux/amd64 | |
| # secrets: inherit | |
| # deploy: | |
| # name: Deploy pr environment | |
| # uses: ./.github/workflows/extralit-frontend.deploy-environment.yml | |
| # needs: build_dev_docker_image | |
| # if: | | |
| # !cancelled() && | |
| # needs.build_dev_docker_image.result == 'success' && | |
| # github.event_name == 'pull_request' && github.event.pull_request.draft == false | |
| # with: | |
| # image-name: extralit/extralit-frontend-for-dev | |
| # image-version: ${{ needs.build_dev_docker_image.outputs.version }} | |
| # secrets: inherit |