-
Notifications
You must be signed in to change notification settings - Fork 330
ci: auto deploy site #2617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: auto deploy site #2617
Conversation
WalkthroughThe pull request introduces several changes to the auto-deployment workflow configuration, including updates to permissions and action versions. A new shell script is added to facilitate the copying of Markdown files between directories. Additionally, a new environment configuration file is created to define essential variables for the application. The Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
[e2e-test-warn] The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug". Please make sure you've read our contributing guide |
84194ff to
f6bcf88
Compare
f6bcf88 to
59427db
Compare
59427db to
b989412
Compare
b989412 to
6e2f601
Compare
8fd6411 to
e19da76
Compare
cc41d97 to
7dae2ae
Compare
7dae2ae to
4075ef7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
.github/workflows/auto-deploy-site.yml (2)
38-38: Consider investigating high memory usageSetting
--max-old-space-size=8192indicates significant memory requirements during the build. Consider:
- Analyzing the build process for memory leaks or optimization opportunities
- Implementing incremental builds if possible
46-52: Document the repair steps in commentsThe repair steps are crucial for deployment but lack documentation. Consider adding comments explaining:
- Why 777 permissions are necessary
- The purpose of copying commonjs helpers
- The reason for path modifications in design-common.js
- name: Repair build artifact run: | + # Grant full permissions to ensure GitHub Pages can access files sudo chmod -R 777 ./_site + # Copy required commonjs helpers to assets cp ./examples/sites/dist/assets/_commonjsHelpers*.js ./_site/assets + # Create 404 page from index for SPA routing cp ./_site/index.html ./_site/404.html + # Update static asset paths for GitHub Pages deployment sed -i 's/\/static/\/tiny-vue\/static/' ./_site/static/js/design-common.js + # Copy component documentation sh ./examples/sites/dist/cp-component-md.sh
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
.github/workflows/auto-deploy-site.yml(2 hunks)examples/sites/cp-component-md.sh(1 hunks)examples/sites/env/.env.pages(1 hunks)examples/sites/package.json(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- examples/sites/cp-component-md.sh
- examples/sites/env/.env.pages
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/auto-deploy-site.yml
[error] 66-66: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (4)
.github/workflows/auto-deploy-site.yml (4)
26-27: LGTM: Required permission for deployment
The addition of contents: write permission is necessary for the build job to modify repository contents during deployment.
40-40: LGTM: Action version updates
The updates to latest versions of GitHub Actions (configure-pages@v5, upload-pages-artifact@v3, deploy-pages@v4) follow security best practices.
Also applies to: 54-54, 63-63
64-66: LGTM: Standard GitHub Pages environment setup
The environment configuration is correctly set up for GitHub Pages deployment.
🧰 Tools
🪛 yamllint (1.35.1)
[error] 66-66: no new line character at the end of file
(new-line-at-end-of-file)
36-36: Verify the scope of dependency installation
The removal of the package filter -F @opentiny/vue-docs means all workspace dependencies will be installed. While this ensures all required dependencies are available, it might impact build time.
✅ Verification successful
Let me gather more information about the workspace and dependencies.
Based on the package.json analysis, I can now generate the final response:
Removing package filter is justified
The @opentiny/vue-docs package has multiple workspace dependencies including core packages, themes, icons, and design systems. Installing only the docs package without its workspace dependencies would lead to build failures. The removal of -F @opentiny/vue-docs filter is necessary to ensure all required dependencies are properly installed.
Key dependencies that justify this change:
- Core dependencies:
@opentiny/vue,@opentiny/vue-common - Design systems:
vue-design-aurora,vue-design-saas,vue-design-smb - Themes:
vue-theme,vue-theme-mobile,vue-theme-saas - Icons:
vue-icon,vue-icon-multicolor,vue-icon-saas
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check the dependency tree to understand the scope
pnpm list -r --json | jq '.[] | select(.name=="@opentiny/vue-docs") | .dependencies'
Length of output: 91
Script:
#!/bin/bash
# Check workspace packages and their dependencies
fd package.json --type f --exclude node_modules --exclude .git | xargs cat | jq -r 'select(.name != null) | "\(.name):\n dependencies: \(.dependencies // {})\n devDependencies: \(.devDependencies // {})\n"'
Length of output: 11799
| "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", |
There was a problem hiding this comment.
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.pagesis properly configured with necessary variablescp-component-md.shexists 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:
- The
.env.pagesfile exists with proper configuration - The
cp-component-md.shscript 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
PR
使用 GitHub Actions 自动化部署 TinyVue 网站,只要修改了 examples/sites 下的组件 demo,代码合入 dev 分支,就会自动构建和部署 TinyVue 网站,方便快速看到效果。
部署之后的地址:https://opentiny.github.io/tiny-vue
效果如下:
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Release Notes
New Features
Improvements
These changes improve deployment efficiency and enhance the application's configuration capabilities.