Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/deploy-docs-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy Docs Preview

permissions: {}

on:
pull_request:
paths:
- 'docs/**'
- 'packages/cli/install.sh'
- 'packages/cli/install.ps1'
- '.github/workflows/deploy-docs-preview.yml'

concurrency:
group: deploy-docs-preview-${{ github.event.pull_request.number }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
staging-deploy:
if: github.repository == 'voidzero-dev/vite-plus'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
env:
VOID_PROJECT: viteplus-staging
PREVIEW_URL: https://viteplus-staging.void.app/
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2

- uses: voidzero-dev/setup-vp@ca1c46663915d6c1042ae23bd39ab85718bfb0fa # v1.10.0
with:
cache: true
working-directory: docs
cache-dependency-path: docs/pnpm-lock.yaml

- run: vp run build
working-directory: docs

- run: vpx void deploy --dir docs/.vitepress/dist
env:
VOID_TOKEN: ${{ secrets.VOID_TOKEN }}

- name: Comment on PR
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
PREVIEW_URL: ${{ env.PREVIEW_URL }}
with:
script: |
const marker = '<!-- staging-deploy -->';
const body = `${marker}\n✅ Staging deployment successful!\n\nPreview: ${process.env.PREVIEW_URL}\nCommit: ${context.payload.pull_request.head.sha}`;
const comments = await github.paginate(github.rest.issues.listComments, {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const existing = comments.find(c => c.body.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
});
}
45 changes: 45 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Docs

permissions: {}

on:
push:
branches: [main]
paths:
- 'docs/**'
- 'packages/cli/install.sh'
- 'packages/cli/install.ps1'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:

concurrency:
group: deploy-docs
cancel-in-progress: false

defaults:
run:
shell: bash

jobs:
deploy:
if: github.repository == 'voidzero-dev/vite-plus'
runs-on: ubuntu-latest
permissions:
contents: read
env:
VOID_PROJECT: viteplus
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2

- uses: voidzero-dev/setup-vp@ca1c46663915d6c1042ae23bd39ab85718bfb0fa # v1.10.0
with:
cache: true
working-directory: docs
cache-dependency-path: docs/pnpm-lock.yaml

- run: vp run build
working-directory: docs

- run: vpx void deploy --dir docs/.vitepress/dist
env:
VOID_TOKEN: ${{ secrets.VOID_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ rolldown
rolldown-vite
vite
/crates/vite_global_cli/vp
.void/
Loading