mirror of
https://github.com/muhac/chinese-holidays-calendar.git
synced 2024-11-21 01:01:50 +08:00
4776475589
testing ip
71 lines
1.7 KiB
YAML
71 lines
1.7 KiB
YAML
name: Continuous Delivery
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 0 1/16 * *"
|
|
push:
|
|
branches:
|
|
- "main"
|
|
|
|
jobs:
|
|
main:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
fetch-depth: 2
|
|
|
|
- name: Setup Python environment
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install Python dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
|
|
- name: Run crawler script
|
|
shell: bash
|
|
run: python crawler.py
|
|
|
|
- name: Run global scripts
|
|
shell: bash
|
|
run: |
|
|
for script in global/*/main.py; do
|
|
cd $(dirname $script)
|
|
python $(basename $script)
|
|
done
|
|
|
|
- name: Setup Haskell and Cabal
|
|
uses: haskell-actions/setup@v2
|
|
with:
|
|
ghc-version: "9.6"
|
|
cabal-version: "3.10"
|
|
|
|
- name: Build parser
|
|
run: cabal build
|
|
|
|
- name: Generate ICS files
|
|
run: cabal run
|
|
|
|
- name: Generate global data
|
|
shell: bash
|
|
run: |
|
|
for script in global/*/deploy.sh; do
|
|
cd $(dirname $script)
|
|
bash $(basename $script) 2>/dev/null
|
|
done
|
|
|
|
- name: Commit changes
|
|
uses: stefanzweifel/git-auto-commit-action@v5
|
|
with:
|
|
file_pattern: README.md data/* global/*/data/* docs/* docs/global/*/*
|
|
commit_message: update calendar data automatically
|
|
commit_user_name: Muhan Li
|
|
commit_user_email: 77625954+muhav@users.noreply.github.com
|
|
commit_author: Muhan Li <77625954+muhav@users.noreply.github.com>
|