Skip to content

Commit

Permalink
Create unlighthouse action
Browse files Browse the repository at this point in the history
  • Loading branch information
mirhamasala committed Oct 9, 2023
1 parent 24ad3c2 commit 59a5020
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/create-unlighthouse-reports.yml
@@ -0,0 +1,44 @@
name: Create Unlighthouse Reports

on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:

jobs:
unlighthouse:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install dependencies
run: |
npm install -g @unlighthouse/cli puppeteer
- name: Remove old reports
run: rm -rf public/unlighthouse/*

- name: Run Unlighthouse CI
run: unlighthouse-ci --config unlighthouse.config.ts --build-static

- name: Create new branch and commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git checkout -b reports-update-$(date +'%Y%m%d%H%M%S')
git add -A
git commit -m "Update reports"
git push origin HEAD
- name: Create pull request
run: |
gh pr create --title "Automated Report Update" --body "This is an automated report update. Please review before merging." --base main --head $(git rev-parse --abbrev-ref HEAD)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1 comment on commit 59a5020

@vercel
Copy link

@vercel vercel bot commented on 59a5020 Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.