Skip to content

Commit

Permalink
Add sync workflow to push changes to Codeup repository
Browse files Browse the repository at this point in the history
  • Loading branch information
kressety committed Jan 19, 2024
1 parent 3bd9643 commit 691d05f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Sync to Codeup

on:
push:
branches:
- main

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checking out GitHub repository
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Pushing to another repository
if: ${{ secrets.TARGET_REPO }}
env:
TARGET_REPO: ${{ secrets.TARGET_REPO }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa codeup.aliyun.com >> ~/.ssh/known_hosts
git remote add target "$TARGET_REPO"
git push target HEAD:main --force

0 comments on commit 691d05f

Please sign in to comment.