omnidash/.github/workflows/seo-report.yaml

42 lines
1.1 KiB
YAML

name: Unlighthouse SEO Reports
on:
deployment_status
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install Dependencies
run: yarn global add @unlighthouse/cli puppeteer gh-pages
- name: Build Unlighthouse report
run: unlighthouse-ci --site "${{ github.event.deployment_status.target_url }}" --build-static --router-prefix ${{ github.event.repository.name }}
- name: Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
run: |
echo "baseurl: /$(basename $GITHUB_REF)" >> _config.yml
npx gh-pages --dist ./.unlighthouse --repo $(basename $GITHUB_REPOSITORY) --branch gh-pages