mirror of
https://github.com/Coldsmiles/infstarweb.git
synced 2026-04-23 02:30:41 +08:00
67 lines
1.4 KiB
YAML
67 lines
1.4 KiB
YAML
name: Deploy to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
schedule:
|
|
# Every days at 04:00 UTC
|
|
- cron: "0 4 */1 * *"
|
|
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 Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Install Python dependencies
|
|
run: pip install requests tqdm
|
|
|
|
- name: Run statsprocess.py
|
|
env:
|
|
STATS_BASE_URL: ${{ secrets.STATS_BASE_URL }}
|
|
STATS_USER: ${{ secrets.STATS_USER }}
|
|
STATS_PASS: ${{ secrets.STATS_PASS }}
|
|
run: python statsprocess.py
|
|
|
|
- name: Prepare Pages artifact
|
|
run: |
|
|
mkdir -p _site
|
|
rsync -a --delete \
|
|
--exclude '.git/' \
|
|
--exclude '.github/' \
|
|
--exclude 'README.md' \
|
|
--exclude 'statsprocess.py' \
|
|
./ ./_site/
|
|
|
|
- name: Upload Pages artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./_site
|
|
|
|
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
|