daily update #19833
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
# This is a basic workflow to help you get started with Actions | |
name: daily update | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
schedule: | |
- cron: '0 */6 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
#runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v2 | |
- name: set up python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12.2' | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: ${{ runner.os }}-pip- | |
- name: install dependencies | |
run: pip install --upgrade -r requirements.txt | |
- name: run script | |
run: | | |
git pull | |
python wmyblog_coron.py | |
- name: git push | |
run: | | |
git add . | |
git config --global user.name "Taizi Huang" | |
git config --global user.email "htzllt@gmail.com" | |
git commit -m "GitHub Actions Auto Builder at $(date +'%Y-%m-%d %H:%M:%S')" --allow-empty | |
git push |