-
Notifications
You must be signed in to change notification settings - Fork 8
37 lines (35 loc) · 1.06 KB
/
repo-sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Sync Repository
run-name: Sync Repository at commit ${{ github.ref }}
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
Sync-Repository:
runs-on: ubuntu-latest
steps:
- name: Sleep 2 Minutes
run: |
sleep 120
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.FORGE_DEPLOY_KEY }}
- name: Prep Remotes
run: |
cd ${{ github.workspace }}
# Ignore hosts keys, since we accept them as-is, add remotes
git config --global core.sshCommand 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
git remote add forge git@${{ secrets.FORGE_DOMAIN }}:${{ github.repository }}.git &> /dev/null
- name: Push Code
run: |
cd ${{ github.workspace }}
git push forge ${{ github.ref_name }} &> /dev/null