使用抱脸SDK创建青龙面板 #1
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: 使用抱脸SDK创建青龙面板 | |
| on: | |
| repository_dispatch: | |
| workflow_dispatch: | |
| inputs: | |
| Token: | |
| description: '抱脸的Token,需要写权限' | |
| required: true | |
| default: '' | |
| Admin: | |
| description: '青龙管理用户名' | |
| required: false | |
| default: '' | |
| Password: | |
| description: '青龙管理密码' | |
| required: false | |
| default: '' | |
| Image: | |
| description: '青龙docker镜像地址' | |
| required: false | |
| default: '' | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| if: github.event.repository.owner.id == github.event.sender.id | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| persist-credentials: true # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
| fetch-depth: 0 | |
| - name: 隐藏输入信息 | |
| uses: levibostian/action-hide-sensitive-inputs@v1 | |
| - name: 安装Rclone | |
| run: | | |
| curl https://rclone.org/install.sh | sudo bash | |
| - name: 检查系统依赖 | |
| run: | | |
| rclone -V | |
| python -V | |
| - name: 配置Rclone | |
| run: | | |
| printf "$RCLONE_ENV_FILE" >> ~/.config/rclone/rclone.conf | |
| shell: bash | |
| env: | |
| RCLONE_ENV_FILE : ${{secrets.RCLONE_CONF}} | |
| - name: 安装所需依赖 | |
| run: | | |
| python -m pip install --upgrade pip wheel | |
| pip install huggingface_hub | |
| - name: 运行脚本 | |
| run: | | |
| rclone_conf_path=$(rclone config file | awk 'NR==2') | |
| python qinglong.py --token="${{ github.event.inputs.Token}}" --rclone_conf_path="$rclone_conf_path" --admin="${{ github.event.inputs.Admin}}" --password="${{ github.event.inputs.Password}}" --image="${{ github.event.inputs.Image}}" | |
| # - name: Delete workflow runs | |
| # uses: Mattraks/delete-workflow-runs@v1.2.3 | |
| # with: | |
| # token: ${{ github.token }} | |
| # repository: ${{ github.repository }} | |
| # retain_days: 0 | |
| # keep_minimum_runs: 0 |