feat(action): resource mirroring #3
Workflow file for this run
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: mirror | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 */6 * * *" | |
push: | |
branches: | |
- master | |
- dev | |
- hotfix | |
jobs: | |
cook: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Checkout Branch | |
uses: actions/checkout@v4 | |
with: | |
ref: dev | |
path: src | |
- name: Checkout Mirror | |
env: | |
GITEE_SSH_KEY: ${{ secrets.GITEE_SSH_KEY }} | |
run: | | |
git clone https://${{ secrets.GITEE_USER }}:${{ secrets.GITEE_TOKEN }}@gitee.com/${{ secrets.GITEE_USER }}/${{ secrets.GITEE_REPO }}.git mirror && \ | |
cd mirror && \ | |
rm -rf * | |
- name: Copy | |
run: | | |
pip install ./src/ && \ | |
cd mirror && \ | |
genpac -c ./config.ini | |
- name: Commit Mirror | |
run: | | |
cd mirror && \ | |
git add . && \ | |
git commit -m "update $(date '+%Y-%m-%d %H:%M:%S %z')" && \ | |
git push --force |