phase 2 TAPS #8
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: Deploy ToolVault to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build Application | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'yarn' | |
| cache-dependency-path: toolvault-frontend/yarn.lock | |
| - name: Install dependencies | |
| working-directory: toolvault-frontend | |
| run: yarn install --frozen-lockfile | |
| - name: Type check | |
| working-directory: toolvault-frontend | |
| run: yarn typecheck | |
| - name: Lint | |
| working-directory: toolvault-frontend | |
| run: yarn lint | |
| - name: Build application | |
| working-directory: toolvault-frontend | |
| env: | |
| GITHUB_PAGES: true | |
| run: yarn build | |
| - name: Copy JavaScript bundle to dist | |
| run: | | |
| mkdir -p toolvault-frontend/dist/examples | |
| cp -r examples/javascript-bundle toolvault-frontend/dist/examples/ | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-files | |
| path: toolvault-frontend/dist/ | |
| retention-days: 7 | |
| test-javascript-bundle: | |
| name: Test Phase 0 JavaScript Tools | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| cache-dependency-path: examples/javascript-bundle/package-lock.json | |
| - name: Install dependencies | |
| working-directory: examples/javascript-bundle | |
| run: npm ci | |
| - name: Run tests with coverage | |
| working-directory: examples/javascript-bundle | |
| run: npm test -- --coverage --watchAll=false | |
| - name: Validate bundle structure | |
| working-directory: examples/javascript-bundle | |
| run: npm run validate | |
| deploy: | |
| if: github.ref == 'refs/heads/main' | |
| needs: [build, test-javascript-bundle] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-files | |
| path: dist/ | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload to GitHub Pages | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist/ | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |