mirror of
https://github.com/bartvdbraak/omnidash.git
synced 2025-04-27 23:41:21 +00:00
57 lines
1.7 KiB
YAML
57 lines
1.7 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:
|
|
if: github.event.deployment_status.state == 'success'
|
|
environment:
|
|
name: github-pages
|
|
url: https://${{ github.repository_owner }}.github.io/${{ github.head_ref }}/
|
|
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
|
|
|
|
- name: Get Deployment Source Branch Name
|
|
id: git-branch
|
|
run: |
|
|
git branch -a --contains ${{ github.event.deployment.ref }}
|
|
source_branches="$(git branch -a --contains ${{ github.event.deployment.ref }})"
|
|
result=$(echo "$source_branches" | tail -n1 | sed 's/^[ \t]*//')
|
|
echo "Remote source of deployment: ${result}"
|
|
echo "Local git ref of deployment: ${result#remotes/origin/*}"
|
|
echo "SOURCE_REF=${result#remotes/origin/*}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build Unlighthouse report
|
|
run: |
|
|
unlighthouse-ci \
|
|
--site "${{ github.event.deployment_status.target_url }}" \
|
|
--build-static \
|
|
--router-prefix "${{ github.event.repository.name }}/${{ github.head_ref }}"
|
|
|
|
- name: Deploy
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GH_PAGES_TOKEN }}
|
|
publish_dir: ./.unlighthouse
|
|
destination_dir: ${{ github.head_ref }}
|
|
|