Skip to content

Commit

Permalink
ci: add doc previews
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackDark committed Nov 23, 2024
1 parent 4e94ca2 commit 7129e1f
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/doc-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Documentation (Preview)

on:
pull_request:
branches: [main]
paths:
- docs/**
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4
with:
version: latest

- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- name: Install & build
working-directory: docs
run: |
pnpm i
pnpm build
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy ./docs/build --project-name=configarr-preview
# Optional: Enable this if you want to have GitHub Deployments triggered
#gitHubToken: ${{ secrets.GITHUB_TOKEN }}

- name: Comment PR
uses: thollander/actions-comment-pull-request@v3
with:
message: |
Doc preview deployed to: ${{ steps.deploy.outputs.deployment-url }}
comment-tag: docs-preview

0 comments on commit 7129e1f

Please sign in to comment.