- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2
 
Add GitHub Actions CI/CD workflow with branch-specific deployment controls #8
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
Conversation
Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
        
          
                .github/workflows/main.yml
              
                Outdated
          
        
      | on: | ||
| push: | ||
| branches: | ||
| - '*' | 
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.
| - '*' | |
| - '**' | 
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.
Updated branch pattern to ** for better glob matching. (a89f2c0)
        
          
                .github/workflows/main.yml
              
                Outdated
          
        
      | 
               | 
          ||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | 
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.
| version: 9 | |
| version: 10 | 
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.
Updated pnpm version to 10. (a89f2c0)
| - name: Deploy to GitHub pages | ||
| uses: peaceiris/actions-gh-pages@v4 | ||
| with: | 
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.
@copilot 此处加一个判断:在非主分支时不要部署到 GitHub pages。
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.
Added condition if: github.ref == 'refs/heads/master' to deploy to GitHub Pages only on the main branch. (a89f2c0)
…and add main branch check for GitHub Pages deployment Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
This PR adds a complete CI/CD pipeline using GitHub Actions to automate the build and deployment process for the GitHub 中文版 application.
Features
The workflow provides automated deployment with the following capabilities:
**)pnpm i --frozen-lockfilepnpm build(outputs todist/directory)peaceiris/actions-gh-pages@v4, but only when pushing to the master branch to prevent unintended deployments from feature branchesVERCEL_TOKEN,VERCEL_ORG_ID,VERCEL_PROJECT_ID)Key Safety Features
Compatibility
The workflow is fully compatible with this project's setup:
dist/directory (confirmed working)The deployment pipeline will now automatically publish the GitHub 中文版 application when changes are pushed to the master branch, while still providing CI validation for all branches.
Fixes #7.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.