-
Notifications
You must be signed in to change notification settings - Fork 268
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: add auto deploy site #2582
ci: add auto deploy site #2582
Conversation
WalkthroughThis pull request introduces a new GitHub Actions workflow file, Changes
Possibly related PRs
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 |
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: 3
🧹 Outside diff range and nitpick comments (1)
.github/workflows/auto-deploy-site.yml (1)
3-20
: Consider adding environment protection rulesThe workflow configuration is well-structured with appropriate triggers and permissions. However, to enhance security, consider setting up environment protection rules for the
github-pages
environment to restrict deployments to specific branches or require approvals.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/auto-deploy-site.yml
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/auto-deploy-site.yml
28-28: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
38-38: the runner of "actions/configure-pages@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
57-57: the runner of "actions/deploy-pages@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 yamllint (1.35.1)
.github/workflows/auto-deploy-site.yml
[error] 57-57: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (1)
.github/workflows/auto-deploy-site.yml (1)
1-57
: Verify no conflicting workflows exist
Let's ensure there are no other workflows that might conflict with this new auto-deploy functionality.
✅ Verification successful
No conflicting workflows found
The verification shows that auto-deploy-site.yml
is the only workflow file handling GitHub Pages deployments and site-related tasks. No other workflows are targeting the same paths or using similar deployment actions, which confirms there won't be any conflicts with this new workflow.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for other workflow files that might handle site deployment
fd -e yml -e yaml . .github/workflows/ --exec grep -l "github-pages\|deploy.*site\|site.*deploy"
Length of output: 137
Script:
#!/bin/bash
# Let's do a more thorough check for any deployment-related workflows
# 1. Check for any workflow files with 'deploy' or 'pages' in their content
fd -e yml -e yaml . .github/workflows/ --exec grep -l "deploy\|pages"
# 2. Look for specific GitHub Pages and deployment-related actions in workflows
fd -e yml -e yaml . .github/workflows/ --exec grep -A 3 "uses: actions/deploy-pages\|uses: actions/configure-pages\|uses: actions/jekyll-build-pages"
# 3. Check for similar path triggers in other workflows
fd -e yml -e yaml . .github/workflows/ --exec grep -A 2 "paths:\|examples/sites"
Length of output: 913
🧰 Tools
🪛 actionlint (1.7.4)
28-28: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
38-38: the runner of "actions/configure-pages@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
57-57: the runner of "actions/deploy-pages@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 yamllint (1.35.1)
[error] 57-57: no new line character at the end of file
(new-line-at-end-of-file)
- name: Install deps | ||
run: pnpm -F @opentiny/vue-docs i --no-frozen-lockfile |
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.
Use frozen lockfile for deterministic builds
Using --no-frozen-lockfile
in CI/CD can lead to inconsistent builds. It's recommended to use frozen lockfile to ensure reproducible builds.
- run: pnpm -F @opentiny/vue-docs i --no-frozen-lockfile
+ run: pnpm -F @opentiny/vue-docs i --frozen-lockfile
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- name: Install deps | |
run: pnpm -F @opentiny/vue-docs i --no-frozen-lockfile | |
- name: Install deps | |
run: pnpm -F @opentiny/vue-docs i --frozen-lockfile |
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 |
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.
Update deploy action version and add newline
The deploy job needs some minor fixes:
- Update to latest deploy-pages action
- Add newline at end of file
Apply these changes:
- name: Deploy to GitHub Pages
id: deployment
- uses: actions/deploy-pages@v1
+ uses: actions/deploy-pages@v4
+
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
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 | |
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@v4 | |
🧰 Tools
🪛 actionlint (1.7.4)
57-57: the runner of "actions/deploy-pages@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 yamllint (1.35.1)
[error] 57-57: no new line character at the end of file
(new-line-at-end-of-file)
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
- name: Install deps | ||
run: pnpm -F @opentiny/vue-docs i --no-frozen-lockfile | ||
- name: Build site | ||
run: pnpm -F @opentiny/vue-docs build | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v2 | ||
- name: Build with Jekyll | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: ./examples/sites/dist | ||
destination: ./_site | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
|
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.
Update action versions and add Node.js setup
Several improvements needed in the build job:
- Action versions are outdated
- Missing Node.js setup step
Apply these changes:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '18'
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Setup Pages
- uses: actions/configure-pages@v2
+ uses: actions/configure-pages@v4
- name: Upload artifact
- uses: actions/upload-pages-artifact@v1
+ uses: actions/upload-pages-artifact@v3
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: Install deps | |
run: pnpm -F @opentiny/vue-docs i --no-frozen-lockfile | |
- name: Build site | |
run: pnpm -F @opentiny/vue-docs build | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./examples/sites/dist | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: Install deps | |
run: pnpm -F @opentiny/vue-docs i --no-frozen-lockfile | |
- name: Build site | |
run: pnpm -F @opentiny/vue-docs build | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./examples/sites/dist | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 |
🧰 Tools
🪛 actionlint (1.7.4)
28-28: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
38-38: the runner of "actions/configure-pages@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
PR
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
New Features
dev
branch.Improvements