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
25 changes: 17 additions & 8 deletions .github/workflows/auto-deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
# Build job
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -31,27 +33,34 @@ jobs:
with:
version: 9
- name: Install deps
run: pnpm -F @opentiny/vue-docs i --ignore-scripts --no-frozen-lockfile
run: pnpm i --no-frozen-lockfile
- name: Build site
run: pnpm -F @opentiny/vue-docs build
run: export NODE_OPTIONS="--max-old-space-size=8192" && pnpm -F @opentiny/vue-docs build
- name: Setup Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./examples/sites/dist
destination: ./_site
- name: Repair build artifact
run: |
sudo chmod -R 777 ./_site
cp ./examples/sites/dist/assets/_commonjsHelpers*.js ./_site/assets
cp ./_site/index.html ./_site/404.html
sed -i 's/\/static/\/tiny-vue\/static/' ./_site/static/js/design-common.js
sh ./examples/sites/dist/cp-component-md.sh
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
7 changes: 7 additions & 0 deletions examples/sites/cp-component-md.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

for file in ./examples/sites/dist/\@demos/app/*
do
component=${file##*/}
cp ./examples/sites/dist/\@demos/app/${component}/webdoc/*.md ./_site/\@demos/app/${component}/webdoc
done
8 changes: 8 additions & 0 deletions examples/sites/env/.env.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 1、声明一个变量
VITE_CONTEXT=/tiny-vue/
VITE_BUILD_TARGET='inner'
# 官网应用类型:pc / mobile / mobile-first
VITE_APP_MODE='pc'

VITE_APP_BUILD_BASE_URL='/tiny-vue/'
VITE_PLAYGROUND_URL=/playground.html
2 changes: 1 addition & 1 deletion examples/sites/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build:saas:alpha": "vite build --mode innersaas",
"build:saas:open": "vite build --mode saasopen",
"build:saas:prod": "vite build --mode saasprod",
"build": "vite build",
"build": "vite build --mode pages && cp cp-component-md.sh ./dist",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Environment configuration and script are present but script needs executable permissions

The verification shows that both required files exist:

  • .env.pages is properly configured with necessary variables
  • cp-component-md.sh exists but lacks executable permissions (current: -rw-r--r--)

To ensure proper build execution, make the script executable with:

chmod +x examples/sites/cp-component-md.sh
🔗 Analysis chain

Verify pages mode configuration

The build script now includes --mode pages and copies the component documentation script. Please ensure:

  1. The .env.pages file exists with proper configuration
  2. The cp-component-md.sh script is properly versioned
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for environment configuration
if [ -f "examples/sites/env/.env.pages" ]; then
  echo "Found .env.pages configuration"
  cat "examples/sites/env/.env.pages"
else
  echo "Missing .env.pages configuration"
fi

# Verify script exists and is executable
if [ -f "examples/sites/cp-component-md.sh" ]; then
  echo "Found cp-component-md.sh script"
  ls -l "examples/sites/cp-component-md.sh"
else
  echo "Missing cp-component-md.sh script"
fi

Length of output: 584

"build:open": "vite build --mode open",
"prettier": "npx prettier --write ./**/*.{ts,tsx,css,less,scss,vue}",
"stylelint": "npx stylelint ./src/**/*.scss ./src/**/*.less ./src/**/*.css --fix",
Expand Down
Loading