Skip to content

fix(deps): update dependency astro to v5 #124

fix(deps): update dependency astro to v5

fix(deps): update dependency astro to v5 #124

Workflow file for this run

name: πŸ” Preview
on:
pull_request:
paths:
- "**.astro"
- "**.ts"
- bun.lockb
- "!**.test.ts"
jobs:
deploy:
name: πŸš€ Deploy to the Preview
permissions:
contents: read
deployments: write
runs-on: Ubuntu-Latest
outputs:
url: ${{ steps.deploy.outputs.deployment-url }}
steps:
- name: 🚚 Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🍞 Setup Bun with Cache
uses: 5ouma/utils/setup-bun-with-cache@656f6ff07954741b23ddb303c26a87d0e40b4a1e # main
- name: πŸ‘Ύ Create a Meta File
run: echo '${{ vars.META_FILE }}' >meta.json
- name: πŸ› οΈ Build
run: bun run build
- name: ⛅️ Deploy to the Preview
id: deploy
uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3.13.0
with:
command: pages deploy dist --project-name='${{ github.event.repository.name }}'
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
lighthouse:
name: πŸ”¦ Analyze Performance
permissions:
pull-requests: write
needs: deploy
runs-on: Ubuntu-Latest
steps:
- name: πŸ”¦ Analyze Performance with Lighthouse
id: lighthouse
uses: treosh/lighthouse-ci-action@2f8dda6cf4de7d73b29853c3f29e73a01e297bd8 # 12.1.0
with:
urls: ${{ needs.deploy.outputs.url }}
- name: πŸ“Š Arrange the Summary
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: summary
with:
result-encoding: string
script: |
const manifest = ${{ steps.lighthouse.outputs.manifest }};
const gauge = Object.entries(manifest[0].summary).map(([label, percentage]) => {
const score = Math.round(percentage * 100);
const icon = score >= 90 ? "🟒" : score >= 50 ? "🟧" : "πŸ”Ί";
return { label, score: `${icon} ${score}` };
});
const labels = `| ${gauge.map(({ label }) => label).join(" | ")} |`;
const scores = `| ${gauge.map(({ score }) => score).join(" | ")} |`;
return `${labels}\n| ${gauge.map(() => ":-:").join(" | ")} |\n${scores}`;
- name: πŸ’¬ Comment the Result
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
with:
message: |
## πŸ”¦ Lighthouse Result
${{ steps.summary.outputs.result }}
<details><summary>πŸ“Š Score Scale</summary>
| Fail | Average | Pass |
| :-----: | :------: | :-------: |
| πŸ”Ί 0-49 | 🟧 50-89 | 🟒 90-100 |
</details>
message-id: lighthouse