From 2886d85bf5a2d9d8d8cf6ae18fcec0a763a7b252 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Thu, 5 Dec 2024 17:33:52 +0300 Subject: [PATCH] add cross way mirror --- .github/build-nest-v3 | 2 +- .github/github_pushback.sh | 31 +++++++++++++++++++ .github/release-canary-v3 | 2 +- .github/release-nest-v3 | 2 +- .github/workflows/build-canaryv3.yml | 11 +++++++ .github/workflows/build-nestv3.yml | 11 +++++++ .github/workflows/github-pushback.yml | 41 ++++++++++++++++++++++++++ .github/workflows/release-canaryv3.yml | 11 +++++++ .github/workflows/release-nestv3.yml | 11 +++++++ 9 files changed, 119 insertions(+), 3 deletions(-) create mode 100755 .github/github_pushback.sh create mode 100644 .github/workflows/github-pushback.yml diff --git a/.github/build-nest-v3 b/.github/build-nest-v3 index 56a6051..45a4fb7 100644 --- a/.github/build-nest-v3 +++ b/.github/build-nest-v3 @@ -1 +1 @@ -1 \ No newline at end of file +8 diff --git a/.github/github_pushback.sh b/.github/github_pushback.sh new file mode 100755 index 0000000..ece0584 --- /dev/null +++ b/.github/github_pushback.sh @@ -0,0 +1,31 @@ +#! /bin/bash + +mkdir -p ~/.ssh +ssh-keyscan -H pika-os.com >> ~/.ssh/known_hosts +ssh-keyscan -H git.pika-os.com >> ~/.ssh/known_hosts +#echo -e "Host git.pika-os.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config +#echo -e "Host git.pika-os.com\n\tIdentityFile ~/.ssh/id_rsa\n\tStrictHostKeyChecking no\n" > ~/.ssh/config +#ssh-agent -a $SSH_AUTH_SOCK > /dev/null +#ssh-add - <<< "$1" + +#export GIT_SSH_COMMAND="ssh -F ~/.ssh/config" + +#ssh -o StrictHostKeyChecking=no -vT git@git.pika-os.com +#ssh -vT git@git.pika-os.com + +# Commit changes to git +git config --global user.name 'Github Gitea Push Back Key - Cosmo' +git config --global user.email 'cosmo@pika-os.com' +#git config --global --add safe.directory /__w/gitea-pika-first-setup/gitea-pika-first-setup + +git clone git@git.pika-os.com:custom-gui-packages/pika-first-setup + +rm -rfv ./gitea-pika-first-setup/.git +cp -rfv ./pika-first-setup/.git ./gitea-pika-first-setup/ + +cd ./gitea-pika-first-setup +git add . +git commit -am"Github Mirror Push Back" +#git config pull.rebase true +#git pull +git push diff --git a/.github/release-canary-v3 b/.github/release-canary-v3 index 56a6051..d00491f 100644 --- a/.github/release-canary-v3 +++ b/.github/release-canary-v3 @@ -1 +1 @@ -1 \ No newline at end of file +1 diff --git a/.github/release-nest-v3 b/.github/release-nest-v3 index d8263ee..301160a 100644 --- a/.github/release-nest-v3 +++ b/.github/release-nest-v3 @@ -1 +1 @@ -2 \ No newline at end of file +8 \ No newline at end of file diff --git a/.github/workflows/build-canaryv3.yml b/.github/workflows/build-canaryv3.yml index bff3d86..255a0c8 100644 --- a/.github/workflows/build-canaryv3.yml +++ b/.github/workflows/build-canaryv3.yml @@ -17,6 +17,17 @@ jobs: options: --privileged -it steps: + + - name: Runner Origin Check + run: | + if [ "${{ secrets.RUNNER_ORIGIN }}" = "github" ]; then + exit 1 + else + true + fi + env: + RUNNER_ORIGIN: ${{ secrets.RUNNER_ORIGIN }} + - uses: actions/checkout@v3 - name: Install SSH key diff --git a/.github/workflows/build-nestv3.yml b/.github/workflows/build-nestv3.yml index 3c9c34d..f051808 100644 --- a/.github/workflows/build-nestv3.yml +++ b/.github/workflows/build-nestv3.yml @@ -17,6 +17,17 @@ jobs: options: --privileged -it steps: + + - name: Runner Origin Check + run: | + if [ "${{ secrets.RUNNER_ORIGIN }}" = "github" ]; then + exit 1 + else + true + fi + env: + RUNNER_ORIGIN: ${{ secrets.RUNNER_ORIGIN }} + - uses: actions/checkout@v3 - name: Install SSH key diff --git a/.github/workflows/github-pushback.yml b/.github/workflows/github-pushback.yml new file mode 100644 index 0000000..edfdde6 --- /dev/null +++ b/.github/workflows/github-pushback.yml @@ -0,0 +1,41 @@ +name: Github Push back to gitea + +on: + push: + branches: + - main + +jobs: + Push: + runs-on: ubuntu-latest + container: + image: ghcr.io/pikaos-linux/pikaos-builder:nestv3 + volumes: + - /proc:/proc + options: --privileged -it + + steps: + + - name: Runner Origin Check + run: | + if [ "${{ secrets.RUNNER_ORIGIN }}" = "github" ]; then + true + else + exit 1 + fi + env: + RUNNER_ORIGIN: ${{ secrets.RUNNER_ORIGIN }} + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.GITEA_SSH_KEY }} + name: id_rsa + known_hosts: ${{ secrets.KNOWN_HOSTS }} + if_key_exists: replace + + - name: Run + run: git clone https://github.com/PikaOS-Linux/gitea-pika-first-setup + + - name: Run + run: ./gitea-pika-first-setup/.github/github_pushback.sh diff --git a/.github/workflows/release-canaryv3.yml b/.github/workflows/release-canaryv3.yml index 436c8ff..fa53734 100644 --- a/.github/workflows/release-canaryv3.yml +++ b/.github/workflows/release-canaryv3.yml @@ -17,6 +17,17 @@ jobs: options: --privileged -it steps: + + - name: Runner Origin Check + run: | + if [ "${{ secrets.RUNNER_ORIGIN }}" = "github" ]; then + exit 1 + else + true + fi + env: + RUNNER_ORIGIN: ${{ secrets.RUNNER_ORIGIN }} + - uses: actions/checkout@v3 - name: Install SSH key diff --git a/.github/workflows/release-nestv3.yml b/.github/workflows/release-nestv3.yml index ed42bb7..05ed7ce 100644 --- a/.github/workflows/release-nestv3.yml +++ b/.github/workflows/release-nestv3.yml @@ -17,6 +17,17 @@ jobs: options: --privileged -it steps: + + - name: Runner Origin Check + run: | + if [ "${{ secrets.RUNNER_ORIGIN }}" = "github" ]; then + exit 1 + else + true + fi + env: + RUNNER_ORIGIN: ${{ secrets.RUNNER_ORIGIN }} + - uses: actions/checkout@v3 - name: Install SSH key