Skip to content

Replace README AND GENERATE SVG #155

Replace README AND GENERATE SVG

Replace README AND GENERATE SVG #155

name: Replace README AND GENERATE SVG
on:
workflow_dispatch:
inputs:
time:
description: 'time list'
required: false
value:
description: 'value list'
required: false
env:
# change env here
GITHUB_NAME: yihong0618
GITHUB_EMAIL: zouzou0208@gmail.com
jobs:
sync:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11.4
# 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 README
run: |
git config --local user.email "${{ env.GITHUB_EMAIL }}"
git config --local user.name "${{ env.GITHUB_NAME }}"
git commit -a -m 'update new heart' || echo "nothing to commit"
git push || echo "nothing to push"