Skip to content

feat(docs): add the input playground at /playground/input (#116) #113

feat(docs): add the input playground at /playground/input (#116)

feat(docs): add the input playground at /playground/input (#116) #113

Workflow file for this run

name: Site
on:
pull_request:
paths: ['apps/docs/**', 'scripts/check-links.mjs', '.github/workflows/site.yml']
push:
branches: [main]
paths: ['apps/docs/**', 'scripts/check-links.mjs', '.github/workflows/site.yml']
workflow_dispatch:
permissions:
contents: read
# One site pipeline per ref; abandon superseded preview runs, never a production deploy.
concurrency:
group: site-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
# The landing page bundles @telixon/core and @telixon/web-sdk, so packages build first.
- run: pnpm build
- run: pnpm --filter @telixon/docs build
- run: pnpm --filter @telixon/docs check:links
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: site-dist
path: apps/docs/dist
if-no-files-found: error
deploy-preview:
# Fork pull requests have no secrets; previews are for same-repo branches only.
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: site-dist
path: dist
- uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0
id: deploy
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=telixon-landing --branch=${{ github.head_ref }}
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const url = '${{ steps.deploy.outputs.deployment-url }}';
const marker = '<!-- site-preview -->';
const body = `${marker}\nSite preview: ${url}`;
const { data: comments } = await github.rest.issues.listComments({
...context.repo,
issue_number: context.issue.number,
});
const existing = comments.find((comment) => comment.body.startsWith(marker));
if (existing) {
await github.rest.issues.updateComment({ ...context.repo, comment_id: existing.id, body });
} else {
await github.rest.issues.createComment({ ...context.repo, issue_number: context.issue.number, body });
}
deploy-production:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build
runs-on: ubuntu-latest
environment:
name: site-production
url: https://telixon.dev
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: site-dist
path: dist
- uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=telixon-landing --branch=main