Run Lighthouse, build, and push #1474
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: Run Lighthouse, build, and push | |
# Run every night at midnight UTC (7PM EST, 8PM EDT). | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
lhci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies with Yarn | |
run: yarn | |
- name: Optionally fetch list of cf.gov pages to test | |
env: | |
TEST_PAGES_URL: ${{ secrets.TEST_PAGES_URL }} | |
run: > | |
[[ -n "${TEST_PAGES_URL}" ]] && wget -O urls.txt "$TEST_PAGES_URL" | |
continue-on-error: true | |
- name: Run Lighthouse CLI against specified cf.gov pages | |
run: yarn lighthouse | |
- name: Process Lighthouse reports to generate reports.json | |
run: yarn process-reports | |
- name: Build the static website | |
run: yarn build | |
env: | |
LIGHTHOUSE_RELATIVE_URL: /cfgov-lighthouse | |
- name: Commit reports and site back to GitHub | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
file_pattern: docs | |
commit_message: Nightly Lighthouse run | |
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> |