-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,30 +3,27 @@ name: Sync to Private Repo | |
on: | ||
push: | ||
branches: | ||
- main # Change this if your main branch has a different name | ||
- main # Change this to match your default branch | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the public repository | ||
- name: Checkout Public Repository | ||
uses: actions/checkout@v3 | ||
# Step 1: Check out the public repository | ||
- name: Checkout Public Repository | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Configure SSH to access the private repository | ||
- name: Set up SSH | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.PRIVATE_REPO_SSH_KEY }} | ||
# Step 2: Configure Git to use Personal Access Token (PAT) | ||
- name: Configure Git | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
# Step 3: Add the private repository as a remote | ||
- name: Add Private Repository as Remote | ||
run: | | ||
git remote add private [email protected]:nsswifter/AcademicApplicationDocuments.git | ||
git fetch private | ||
# Step 4: Push changes to the private repository | ||
- name: Sync Changes to Private Repository | ||
run: | | ||
git push private main | ||
# Step 3: Add the private repository as a remote and sync changes | ||
- name: Sync Changes to Private Repository | ||
env: | ||
PAT: ${{ secrets.PRIVATE_REPO_PAT }} | ||
run: | | ||
git remote add private https://x-access-token:${PAT}@github.com/nsswifter/AcademicApplicationDocuments.git | ||
git push private main |