Image Workflow #6
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: Image Workflow | |
on: | |
push: | |
paths: | |
- 'icon/**' # 图标存放位置,自动监测更新 | |
pull_request: | |
paths: | |
- 'icon/**' # 图标存放位置,自动监测更新 | |
workflow_dispatch: | |
jobs: | |
generate_json: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
- name: Generate JSON | |
run: | | |
python .github/scripts/generate_image_json.py | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: json-artifact | |
path: ${{ github.workspace }}/icon.icons.json | |
- name: Push to pcricon Repository | |
run: | | |
git config user.name "HuTaoii" | |
git config user.email "[email protected]" | |
git add . | |
git commit -m "自动更新图标仓库" | |
git push origin HEAD:main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |