-
Notifications
You must be signed in to change notification settings - Fork 30
44 lines (36 loc) · 1.16 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# 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