Added Sign Up page #36
This file contains 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: Lighthouse | |
on: | |
pull_request: | |
types: | |
- review_requested | |
env: | |
node_version: ${{ vars.NODE_VERSION }} | |
PUBLIC_API_BASE_URL: ${{ vars.PUBLIC_API_BASE_URL }} | |
jobs: | |
lighthouse: | |
name: Lighthouse Auditing | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node_version }} | |
- name: Install dependencies | |
run: npm install | |
- name: Build application | |
run: npm run build | |
- name: Generate URLs | |
id: urls | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const globber = await glob.create('**/src/routes/**/+page.svelte'); | |
const files = await globber.glob(); | |
const urls = files | |
.map(x => x.match(/routes\/([\(a-zA-Z\/\[\]\)]*?)\/?\+page\.svelte/)[1]) | |
.map(x => x.replace('[paperId]', '42').replace('[projectId]', '12').replace(/\([a-z\-]+\)\//g, '')) | |
.map(x => `http://localhost:8080/${x}`) | |
.join('\n'); | |
console.log('generated URLs:', urls); | |
core.setOutput('urls', urls); | |
# Add '& echo ...' to run command in background | |
- name: Serve website | |
run: npm run preview -- --port 8080 & echo "Server started on http://localhost:8080" | |
- name: Audit URLs using Lighthouse | |
uses: treosh/lighthouse-ci-action@v12 | |
with: | |
urls: | | |
${{ steps.urls.outputs.urls }} | |
uploadArtifacts: true | |
configPath: .github/lighthouserc.json |