wxread #23
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: wxread | |
| concurrency: | |
| group: ${{ github.workflow }} # 使用工作流名称作为并发组的key | |
| cancel-in-progress: true # 取消任何正在进行的相同并发组的工作流 | |
| on: | |
| schedule: | |
| # 凌晨任务:北京时间每天 01:00(UTC 前一天 17:00) | |
| - cron: '0 17 * * *' | |
| # 早间任务:北京时间每天 05:00(UTC 前一天 21:00) | |
| #- cron: '0 21 * * *' | |
| # 午间任务:北京时间每天 11:40(UTC 03:40) | |
| #- cron: '40 3 * * *' | |
| # 晚间任务:北京时间每天 22:00(UTC 14:00) | |
| #- cron: '0 14 * * *' | |
| workflow_dispatch: # 手动触发 | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-22.04 | |
| environment: AutoRead # 指定环境 | |
| steps: | |
| - name: Set DNS to Google's DNS | |
| run: | | |
| echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf | |
| echo "nameserver 8.8.4.4" | sudo tee -a /etc/resolv.conf | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install certifi==2024.8.30 charset-normalizer==3.4.0 idna==3.10 requests==2.32.3 urllib3==2.2.3 | |
| - name: Run deployment script | |
| env: | |
| WXREAD_CURL_BASH: ${{ secrets.WXREAD_CURL_BASH }} | |
| PUSH_METHOD: ${{ secrets.PUSH_METHOD }} | |
| PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }} | |
| WXPUSHER_SPT: ${{ secrets.WXPUSHER_SPT }} | |
| TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
| TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| SERVERCHAN_SPT: ${{ secrets.SERVERCHAN_SPT }} | |
| READ_NUM: ${{ vars.READ_NUM }} # 使用 Repository Variables | |
| run: | | |
| python main.py | |
| keepalive-job: | |
| name: Keepalive Workflow | |
| if: ${{ always() }} | |
| needs: deploy | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| steps: | |
| - uses: liskin/gh-workflow-keepalive@v1.2.1 |