Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,30 @@ jobs:
needs: deploy
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: npm install, build
run: |
npm install
npm run build
- name: Build website
run: npm run build

- name: run Lighthouse CI
run: |
npm install -g @lhci/cli@0.15.x
lhci autorun
- name: Run Lighthouse CI
run: >
npx --yes @lhci/cli@0.15.x autorun
--collect.url="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me what this line does, can you give me some context?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 74 (now line 77) constructs the GitHub Pages URL dynamically using repository context variables. github.repository_owner is the owner (e.g., "S7-OpenLearning-Individual") and github.event.repository.name is the repo name (e.g., "DesignPatternPedia"). This creates the full URL: https://s7-openlearning-individual.github.io/DesignPatternPedia/ which is where the site is deployed. This approach makes the workflow self-contained and reusable without hardcoding URLs.

--collect.settings.chromeFlags="--headless --no-sandbox --disable-gpu"

- name: Generate Lighthouse Badges
uses: myactionway/lighthouse-badger-action@v2.2
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The badge generation step may fail if the repository is private or if the lighthouse-badger-action encounters issues writing to the repository. Consider adding error handling or making this step continue on error using 'continue-on-error: true' to prevent the entire workflow from failing if badge generation has issues.

Suggested change
uses: myactionway/lighthouse-badger-action@v2.2
uses: myactionway/lighthouse-badger-action@v2.2
continue-on-error: true

Copilot uses AI. Check for mistakes.
with:
urls: 'https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/'
5 changes: 4 additions & 1 deletion lighthouserc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
module.exports = {
ci: {
collect: {
numberOfRuns: 3,
},
upload: {
target: "temporary-public-storage",
target: 'temporary-public-storage',
},
},
};