Skip to content

Commit

Permalink
feat(action): resource mirroring
Browse files Browse the repository at this point in the history
  • Loading branch information
JinnLynn committed Jul 24, 2024
1 parent 2ee003b commit a4cde75
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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 && \
find . -mindepth 2 -maxdepth 2 -not -path '*/.*' -type f -delete
- 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

0 comments on commit a4cde75

Please sign in to comment.