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
50 changes: 1 addition & 49 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
env:
REPO_OWNER: "nginx"
REPO_NAME: "documentation"
FRONT_DOOR_USERNAME: ${{ secrets.FRONT_DOOR_USERNAME }}
FRONT_DOOR_PASSWORD: ${{ secrets.FRONT_DOOR_PASSWORD }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}

jobs:
deploy-example-site:
Expand All @@ -27,49 +24,4 @@ jobs:
auto_deploy_env: "prod"
secrets:
AZURE_CREDENTIALS: ${{secrets.AZURE_CREDENTIALS_DOCS}}
AZURE_KEY_VAULT: ${{secrets.AZURE_KEY_VAULT_DOCS}}
lighthouseci:
if: github.event.pull_request
needs: call-docs-build-push
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.workflow_run.head_branch }}
- uses: actions/setup-node@v5
with:
node-version: 18
- name: Installing packages
run: npm ci
- name: Generating lighthouse reports for PR and main...
run: |
node performance/lighthouse-script.js
- name: Compare the artifacts for negative differences in performance
continue-on-error: true
run: |
FIELDS=("performance" "accessibility")
for FIELD in "${FIELDS[@]}"; do
PR_VALUE=$(cat lighthouse-reports/pr-report.json | jq -r ".categories.$FIELD.score")
MAIN_VALUE=$(cat lighthouse-reports/main-report.json | jq -r ".categories.$FIELD.score")
echo "$FIELD: PR - $PR_VALUE | Main - $MAIN_VALUE"

if [ $FIELD = "performance" ]; then
LOWER_BOUND=$(echo "$MAIN_VALUE - 0.05" | bc)
UPPER_BOUND=$(echo "$MAIN_VALUE + 0.05" | bc)
if (( $(echo "$PR_VALUE < $LOWER_BOUND" | bc -l) || $(echo "$PR_VALUE > $UPPER_BOUND" | bc -l) )); then
echo "Error: $FIELD score in PR ($PR_VALUE) is less than in MAIN ($MAIN_VALUE)"
exit 1
fi
else
if (( $(echo "$PR_VALUE < $MAIN_VALUE" | bc -l) )); then
echo "Error: $FIELD score in PR ($PR_VALUE) is less than in MAIN ($MAIN_VALUE)"
exit 1
fi
fi
done
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: lighthouse-reports
path: lighthouse-reports/
retention-days: 30
AZURE_KEY_VAULT: ${{secrets.AZURE_KEY_VAULT_DOCS}}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,3 @@ exampleSite/hugo

# Biome
biome.rb

# Local Lighthouse artifacts
*/lighthouse-reports
3 changes: 0 additions & 3 deletions performance/README.md

This file was deleted.

57 changes: 0 additions & 57 deletions performance/lighthouse-script.js

This file was deleted.

Loading
Loading