-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (38 loc) · 1.31 KB
/
cron-lighthouse-report-generator-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Cron Lighthouse Report Generator
on:
schedule:
- cron: '0 5 * * 1'
jobs:
cron-lighthouse-report-generator:
name: 'Cron Lighthouse Report Generator'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }}
- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v9
with:
urls: |
https://web.opentemplatehub.com
uploadArtifacts: true
configPath: .github/lighthouserc.yml
- name: Check for Changes
run: |
rm docs/lighthouse/*
find .lighthouseci -name 'lhr-*.html' -exec sh -c 'x="{}"; cp "$x" "docs/lighthouse/lighthouse-report.html"' \;
rm .lighthouseci/*
if git status --porcelain; then
echo "changes_exist=true" >> $GITHUB_ENV
else
echo "changes_exist=false" >> $GITHUB_ENV
fi
- name: Git Commit and Push
if: ${{ env.changes_exist == 'true' }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "OTH Service User"
git add --all
git commit -am "Workflow/lighthouse report update"
git push