Skip to content

Lighthouse CI PROD #2547

Lighthouse CI PROD

Lighthouse CI PROD #2547

name: Lighthouse CI PROD
on:
schedule:
# run at midnight, 8am + 4pm UTC time
- cron: '0 0,8,16 * * *'
permissions:
id-token: write
contents: read
jobs:
lhci:
name: Lighthouse
runs-on: ubuntu-latest
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LHCI_PROD_BUILD_TOKEN: ${{ secrets.LHCI_PROD_BUILD_TOKEN }}
PSI_API_KEY: ${{ secrets.LHCI_PSI_API_KEY }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 30
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Run Lighthouse CI
run: |
npm install -g @lhci/cli@0.9.x
lhci autorun --config=./lighthouserc-prod.js
lhci upload --target=filesystem --outputDir=./lhci
node format-lh-for-s3.js
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: ${{ secrets.LHCI_S3_REGION }}
role-to-assume: ${{ secrets.LHCI_AWS_ROLE_TO_ASSUME }}
role-session-name: LighthouseGithubAction
- name: Upload to S3
run: |
aws s3 sync lhci/final/ s3://${{ secrets.LHCI_S3_BUCKET }}