Skip to content

post: improvements to example #1727

post: improvements to example

post: improvements to example #1727

Workflow file for this run

name: Test
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- run: npm ci
- run: npm run build
preview:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
outputs:
url: ${{ steps.preview.outputs.url }}
steps:
- name: wait
id: preview
uses: WalshyDev/cf-pages-await@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
project: jpoehnelt
commitHash: ${{ github.sha }}
lighthouse:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
needs: preview
steps:
# checkout need to upload artifacts with hash from git
- uses: actions/checkout@v3
with:
lfs: true
- uses: treosh/lighthouse-ci-action@v10
with:
urls: ${{ needs.preview.outputs.url }}
uploadArtifacts: true
temporaryPublicStorage: true
configPath: .lighthouserc.json
runs: 3
lychee:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
needs: preview
steps:
- uses: actions/cache@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- id: urls
env:
BASE: ${{ needs.preview.outputs.url }}
run: echo "urls=`curl "$BASE/urls.txt" | sed \"s@^@$BASE@\" | tr '\n' ' '`" >> $GITHUB_OUTPUT
- uses: lycheeverse/lychee-action@v1.8.0
with:
args: "--base ${{ needs.preview.outputs.url }} --verbose --cache --max-cache-age 1d --exclude '(reddit|linkedin|twitter|npmjs|lienuc|strava|mastodon\\.thbps)\\.com' --exclude 'mas\\.to' --exclude 'youtube-nocookie\\.com' --exclude 'ngx.timer.at' --exclude 'system/cache' ${{ steps.urls.outputs.urls }}"
fail: true