Skip to content

Update mirror.yml

Update mirror.yml #5

Workflow file for this run

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 && \
ls -lR && \
cat config.ini && \
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