get favicon #148
This file contains hidden or 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: get favicon | |
| # 触发条件 | |
| on: | |
| workflow_dispatch: | |
| # push: | |
| # branches: [master] | |
| # paths: | |
| # - "json/link.json" | |
| schedule: | |
| - cron: '0 0 1 * *' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 迁出代码 | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: true | |
| - name: 安装Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.11.6" | |
| - name: 加载缓存 | |
| uses: actions/cache@v2 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/run_in_Actions/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: 设置时区 | |
| run: sudo timedatectl set-timezone 'Asia/Shanghai' | |
| - name: 安装依赖 | |
| run: | | |
| pip install -r requirements.txt | |
| - name: 执行任务 | |
| run: | | |
| python getFavicon.py | |
| - name: 提交更改 | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| git add favicon | |
| if [ -z "$(git status --porcelain)" ] | |
| then | |
| echo "nothing to update." | |
| else | |
| git commit -m "update favicon" | |
| fi | |
| - name: 推送更改 | |
| uses: ad-m/github-push-action@master | |
| with: | |
| # github_token: ${{ secrets.TOKEN }} | |
| branch: master |