forked from yihong0618/iBeats
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (53 loc) · 1.64 KB
/
replace_readme.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: My Ibeats SVG
on:
workflow_dispatch:
inputs:
time:
description: 'time list'
required: false
value:
description: 'value list'
required: false
env:
# change env here
GITHUB_NAME: MQ-0707
GITHUB_EMAIL: [email protected]
jobs:
sync:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.6
# from pdm
- name: Set Variables
id: set_variables
run: |
echo "::set-output name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
echo "::set-output name=PIP_CACHE::$(pip cache dir)"
- name: Cache PIP
uses: actions/cache@v2
with:
path: ${{ steps.set_variables.outputs.PIP_CACHE }}
key: Ubuntu-pip-${{ steps.set_variables.outputs.PY }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if: steps.pip-cache.outputs.cache-hit != 'true'
- name: Replace README AND generate SVG
run: |
python main.py $'${{ github.event.inputs.time }}' $'${{ github.event.inputs.value }}'
- name: Push new README
uses: github-actions-x/[email protected]
with:
github-token: ${{ secrets.ibeats }}
commit-message: "Replace README"
files: README.md files
rebase: 'true'
name: ${{ env.GITHUB_NAME }}
email: ${{ env.GITHUB_EMAIL }}