Merge branch 'master' of https://github.com/bmukesh23/thirtysixstudio… #10
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 CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
lighthouse: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Set up Node.js environment | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
# Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# Install dependencies required for Headless Chrome | |
- name: Install headless chrome dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
wget \ | |
gnupg \ | |
libxss1 \ | |
libappindicator3-1 \ | |
libindicator7 \ | |
libgbm-dev | |
# Create lhci-report folder to store the Lighthouse report | |
- name: Ensure the lhci-report folder exists | |
run: mkdir -p lhci-report | |
# Run Lighthouse CI to generate the report | |
- name: Run Lighthouse CI | |
# run: npx lighthouse --output-path=lhci-report/report.json | |
run: npx lighthouse https://thirtysixstudiooclone.vercel.app --output json --output-path=lhci-report/report.json --chrome-flags="--no-sandbox --headless" | |
# Check if the report is generated | |
- name: Check report | |
run: ls -la lhci-report/report.json | |
# Update README with Lighthouse scores | |
- name: Update README with Lighthouse scores | |
run: node update-readme.js | |
# Commit and push the updated README | |
- name: Commit updated README | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add README.md | |
git commit -m "Update Lighthouse scores" | |
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/bmukesh23/Thirtysixstudio-clone.git |