Skip to content

Commit

Permalink
add update mirror action
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick committed May 29, 2024
1 parent 1c94cda commit 3220785
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/update-mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
branches:
- '*'
workflow_dispatch:
inputs:
ref:
description: "Why trigger?"
required: true
type: string

name: update mirror

env:
SSH_KEY: "${{ secrets.SSH_KEY_TO_GITEE_MIRROR }}"

jobs:
update_mirror:
name: update mirror
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: clone repo
run: |
rm -rf procfs
mkdir procfs
cd procfs
git clone --bare https://github.com/deepflowio/procfs.git .git
git config --unset core.bare
git reset --hard
- name: push to mirror
run: |
cd procfs
mkdir -p ~/.ssh/
echo "${{ env.SSH_KEY}}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan gitee.com >> ~/.ssh/known_hosts
git remote add gitee [email protected]:deepflowce/procfs.git
git push --no-verify --all gitee -u -f

0 comments on commit 3220785

Please sign in to comment.