🔧 尝试修复文学形式统计数字同步问题 #80
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Mingjian Website | |
| on: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: '0 9 * * *' | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v2 | |
| with: | |
| hugo-version: 'latest' | |
| extended: true | |
| - name: Build website | |
| run: | | |
| echo "🏗️ Building Mingjian website..." | |
| hugo --quiet | |
| echo "✅ Build completed" | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "actions@github.com" | |
| - name: Deploy to docs directory | |
| run: | | |
| echo "🚀 Deploying to docs directory..." | |
| rm -rf docs | |
| cp -r public docs | |
| echo "mingjian-ai.github.io" > docs/CNAME | |
| touch docs/.nojekyll | |
| if git diff --quiet docs/; then | |
| echo "📭 No changes to deploy" | |
| else | |
| echo "📦 Changes detected, committing..." | |
| git add docs/ | |
| git commit -m "GitHub Actions: Auto-deploy website $(date -u '+%Y-%m-%d %H:%M:%S')" | |
| git push origin master | |
| echo "✅ Deployment completed" | |
| fi | |
| - name: Verify deployment | |
| run: | | |
| echo "🔍 Verifying deployment..." | |
| if [ -d "docs" ]; then | |
| echo "✅ docs directory exists" | |
| else | |
| echo "❌ docs directory not found" | |
| exit 1 | |
| fi |