Skip to content

Lighthouse Audit

Lighthouse Audit #1122

name: Lighthouse Audit
on: deployment_status
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
if: github.event.deployment.environment == 'Production' && github.event.deployment_status.state == 'success'
uses: actions/checkout@v2
with:
repository: 'cascandaliato/lighthouse-reports'
ref: master
persist-credentials: false
- name: Audit URLs using Lighthouse 💡🏡
id: LHCIAction
if: github.event.deployment.environment == 'Production' && github.event.deployment_status.state == 'success'
uses: treosh/lighthouse-ci-action@v7
with:
urls: 'https://cascandaliato.com'
uploadArtifacts: true
temporaryPublicStorage: true
- run: cp ${{steps.LHCIAction.outputs.resultsPath}}/lhr*.json $GITHUB_WORKSPACE/cascandaliato.com.json
if: github.event.deployment.environment == 'Production' && github.event.deployment_status.state == 'success'
- name: Commit files
if: github.event.deployment.environment == 'Production' && github.event.deployment_status.state == 'success'
run: |
git config --local user.name "cascandaliato"
git config --local user.email "8927157+cascandaliato@users.noreply.github.com"
git add cascandaliato.com.json
git commit -m "Update lighthouse report for cascandaliato.com"
- name: Push changes
if: github.event.deployment.environment == 'Production' && github.event.deployment_status.state == 'success'
uses: ad-m/github-push-action@master
with:
repository: 'cascandaliato/lighthouse-reports'
github_token: ${{ secrets.PUSH_TOKEN }}