Skip to content

docs: v2.0.0

docs: v2.0.0 #724

Workflow file for this run

name: Build and Deploy Preview
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'src/**'
- 'static/**'
- 'content/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'svelte.config.js'
- 'wrangler.jsonc'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
actions: read
contents: read
deployments: write
pull-requests: write
id-token: write
jobs:
build-and-deploy-preview:
if: ${{ github.event.pull_request.head.repo.owner.login == 'getarcaneapp' && github.actor != 'getarcaneappbot' }}
runs-on: depot-ubuntu-latest
environment:
name: ${{ github.event.pull_request.user.login }}-pr-${{ github.event.pull_request.number }}
url: ${{ env.PREVIEW_BASE }}
env:
PREVIEW_ALIAS: pr-${{ github.event.pull_request.number }}
PREVIEW_BASE: https://pr-${{ github.event.pull_request.number }}-arcane.ofkm.workers.dev
steps:
- name: Checkout PR code
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Vite+
uses: voidzero-dev/setup-vp@ca1c46663915d6c1042ae23bd39ab85718bfb0fa
with:
node-version: latest
cache: true
- name: Install dependencies
run: vp install
- name: Generate content data
run: vp run velite
- name: Build site
run: vp build
- name: Upload and Deploy Preview
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
vp exec wrangler versions upload --preview-alias "$PREVIEW_ALIAS"
- name: Find Comment
uses: peter-evans/find-comment@v4
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'getarcaneappbot'
body-includes: Preview deployed successfully!
- name: Comment preview URL
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
token: ${{ secrets.ARCANE_BOT_TOKEN }}
body: |
Preview deployed successfully!
- Preview: ${{ env.PREVIEW_BASE }}
Built from commit ${{ github.sha }}
edit-mode: replace