rq-sigin-sync #1474
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
name: rq-sigin-sync | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 9,10,16 * * *' | |
env: | |
GITHUB_NAME: XiaoSiHwang | |
GITHUB_EMAIL: [email protected] | |
AESKEY: ${{ secrets.AESKEY }} | |
RQ_EMAIL: ${{ secrets.RQ_EMAIL }} | |
RQ_PASSWORD: ${{ secrets.RQ_PASSWORD }} | |
WEBDAV_URL: ${{ secrets.WEBDAV_URL }} | |
WEBDAV_USERNAME: ${{ secrets.WEBDAV_USERNAME }} | |
WEBDAV_PASSWORD: ${{ secrets.WEBDAV_PASSWORD }} | |
LOCAL_OR_WEBDAV: ${{ secrets.LOCAL_OR_WEBDAV }} | |
## 通知推送配置 | |
# 企业微信机器人 | |
QYWX_KEY: ${{ secrets.QYWX_KEY }} | |
# 叮叮机器人 | |
DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} | |
DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10.13 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10.13" | |
# 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: Run RQ Sigin Sync | |
run: | | |
python scripts/rq/rq_sgin.py | |
- name: Push new cookie | |
run: | | |
git config --local user.email "${{ env.GITHUB_EMAIL }}" | |
git config --local user.name "${{ env.GITHUB_NAME }}" | |
git add . | |
git commit -m 'update rq cookie' || echo "nothing to commit" | |
git push || echo "nothing to push" |