Deploy to GitHub Pages #30
This file contains 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 to GitHub Pages | |
on: | |
schedule: | |
- cron: '0 1 * * 0' # Runs every Sunday at 9 AM China Standard Time (CST, UTC+8) | |
- cron: '0 1 1 * *' # Runs on the 1st of every month at 9 AM China Standard Time (CST, UTC+8) | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
echo szlcsc-help.xiaowine.cc > html/CNAME | |
- name: Run script to generate coupon_details.json | |
run: python main.py | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: html/ # Directory containing your index.html and coupon_details.json |