Skip to content

Commit

Permalink
Merge pull request #19 from SanjeebLama/feature/lighthouse-ci-setup
Browse files Browse the repository at this point in the history
Feature/lighthouse ci setup
  • Loading branch information
SanjeebLama authored Apr 30, 2023
2 parents abf1e20 + aad687d commit 51b5de9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ jobs:
node-version: 16.x

- name: Install Dependencies
run: npm install
run: yarn

- name: Build App
run: npm run build
- name: Build App -- But do you we need to build here?
working-directory: apps/docs
#run: yarn workspace docs run build
run: yarn run build

- name: Deploy to Vercel
- name: Deploy apps/docs to Vercel
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-args: --yes
build-dir: apps/docs/.next

- name: Wait for Deployment
run: |
Expand All @@ -36,6 +39,7 @@ jobs:
- name: Run Lighthouse Tests
run: |
cd apps/docs
npm install -g @lhci/[email protected]
lhci autorun
env:
Expand Down
10 changes: 7 additions & 3 deletions apps/docs/lighthouserc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
module.exports = {
ci: {
collect: {
url: 'http://localhost:3001',
startServerCommand: 'yarn run dev',
// Use this for Prod / dev
url: [
`https://${process.env.PREVIEW_URL}`,
],
// url: 'http://localhost:3001',
startServerCommand:
process.env.NODE_ENV === 'production' ? undefined : 'npm run start',
},
assert: {
preset: 'lighthouse:no-pwa',
Expand All @@ -12,4 +17,3 @@ module.exports = {
},
},
};

15 changes: 11 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env.*local"],
"globalDependencies": [
"**/.env.*local"
],
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
"dependsOn": [
"^build"
],
"outputs": [
".next/**",
"!.next/cache/**"
]
},
"lint": {
"outputs": []
Expand All @@ -13,4 +20,4 @@
"cache": false
}
}
}
}

0 comments on commit 51b5de9

Please sign in to comment.