Files
infstarweb/.github/workflows/deploy.yml
zhangyuheng 124b545ee2 feat: initialize Vue application with main components and styles
- Added App.vue as the main application component with a structured layout.
- Created main.js to bootstrap the Vue application and mount it to the DOM.
- Introduced styles.css for global styling, including responsive design and theming.
- Removed outdated HTML files (stats.html, towns.html) and Python script (statsprocess.py) as part of the migration to a new Vue-based architecture.
- Added Vite configuration (vite.config.js) for building the Vue application.
2026-03-18 10:07:03 +08:00

95 lines
2.2 KiB
YAML

name: Deploy to GitHub Pages
on:
push:
branches: [main]
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install frontend dependencies
run: npm ci
- name: Install Python dependencies
run: pip install requests tqdm
- name: Update player stats
env:
STATS_BASE_URL: ${{ secrets.STATS_BASE_URL }}
STATS_USER: ${{ secrets.STATS_USER }}
STATS_PASS: ${{ secrets.STATS_PASS }}
run: python scripts/statsprocess.py
- name: Build site
run: npm run build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
notify-indexnow:
needs: deploy
runs-on: ubuntu-latest
if: success()
steps:
- name: Submit URLs to IndexNow
env:
INDEXNOW_KEY: ${{ secrets.INDEXNOW_KEY }}
run: |
if [ -z "$INDEXNOW_KEY" ]; then
echo "INDEXNOW_KEY not set, skipping."
exit 0
fi
HOST="bailuyuan.lunadeer.cn"
curl -s -X POST "https://api.indexnow.org/indexnow" \
-H "Content-Type: application/json" \
-d "{
\"host\": \"${HOST}\",
\"key\": \"${INDEXNOW_KEY}\",
\"keyLocation\": \"https://${HOST}/${INDEXNOW_KEY}.txt\",
\"urlList\": [
\"https://${HOST}/\"
]
}"
echo ""
echo "IndexNow notification sent."