fix(deps): update dependency @vercel/speed-insights to v1.2.0 #182
Workflow file for this run
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: CI | |
on: [push] | |
jobs: | |
lhci: | |
name: Lighthouse | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Vercel Action | |
id: vercel_action | |
uses: amondnet/[email protected] | |
with: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} | |
alias-domains: ${{ secrets.PROJECT_NAME}}-git-{{ BRANCH }}-${{ secrets.TEAM_NAME}}.vercel.app | |
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} | |
scope: ${{ secrets.VERCEL_SCOPE }} | |
# 设置子路径变量 | |
- name: Set sub-paths based on branch | |
id: sub_paths | |
env: | |
MAIN_URL: ${{ secrets.MAIN_URL }} | |
HEO_URL: ${{ secrets.HEO_URL }} | |
NOTRANS_URL: ${{ secrets.NOTRANS_URL }} | |
run: | | |
sub_paths="" | |
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then | |
if [[ -z "${MAIN_URL}" ]]; then | |
sub_paths="${HEO_URL}" | |
else | |
sub_paths="${MAIN_URL}" | |
fi | |
elif [[ "${GITHUB_REF}" == "refs/heads/heo" ]]; then | |
sub_paths="${HEO_URL}" | |
elif [[ "${GITHUB_REF}" == "refs/heads/notrans" ]]; then | |
sub_paths="${NOTRANS_URL}" | |
fi | |
echo "sub_paths=${sub_paths}" >> "$GITHUB_OUTPUT" | |
# 组合完整的 URL | |
- name: Generate URLs | |
id: urls | |
uses: actions/github-script@v7 | |
env: | |
sub_paths: ${{ steps.sub_paths.outputs.sub_paths }} | |
preview_url: ${{ steps.vercel_action.outputs.preview-url }} | |
with: | |
script: | | |
const urls = process.env.sub_paths | |
.split(',') | |
.map((url)=>{ | |
return process.env.preview_url+url | |
}) | |
.join('\n'); | |
core.setOutput('urls', urls); | |
- name: Audit Vercel preview URL using Lighthouse | |
uses: treosh/lighthouse-ci-action@v12 | |
with: | |
urls: | | |
${{ steps.urls.outputs.urls }} | |
runs: 3 | |
configPath: './lighthouserc.js' | |
serverBaseUrl: ${{ secrets.LHCI_SERVER_URL }} | |
serverToken: ${{ secrets.LHCI_SERVER_TOKEN }} | |
basicAuthUsername: ${{ secrets.LHCI_BASIC_AUTH_USERNAME }} | |
basicAuthPassword: ${{ secrets.LHCI_BASIC_AUTH_PASSWORD }} |