File tree Expand file tree Collapse file tree 1 file changed +28
-12
lines changed Expand file tree Collapse file tree 1 file changed +28
-12
lines changed Original file line number Diff line number Diff line change 1
- name : Upload file to remote server
2
- on : [push]
1
+ name : Push to Site Repo
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
3
8
jobs :
4
- build :
5
- name : Build
9
+ update-file :
6
10
runs-on : ubuntu-latest
11
+
7
12
steps :
8
- - name : Upload file to remote server
9
- uses : appleboy/ssh-action@v1
10
- with :
11
- host : ${{ secrets.HOST }}
12
- username : ${{ secrets.USER }}
13
- password : ${{ secrets.PASSWORD }}
14
- port : ${{ secrets.PORT }}
15
- script : cd /var/www/dansl.net/pages && wget -O linux.md https://raw.githubusercontent.com/dansl/LinuxOS-Stuff/refs/heads/main/README.md && git commit -a -m "updated linux.md" && git push
13
+ - name : Checkout current repo
14
+ uses : actions/checkout@v3
15
+
16
+ - name : Update page to target repo
17
+ run : |
18
+ git clone https://x-access-token:${{ secrets.TARGET_REPO_PAT }}@github.com/dansl/dansl.github.io target-repo
19
+ cp build/README.md target-repo/pages/linux.md
20
+
21
+ cd target-repo
22
+ git config user.email "139961+dansl@users.noreply.github.com"
23
+ git config user.name "dansl"
24
+
25
+ if ! git diff --quiet -- pages/linux.md; then
26
+ git add pages/linux.md
27
+ git commit -m "Update page from source repo"
28
+ git push origin main
29
+ else
30
+ echo "No changes to commit."
31
+ fi
You can’t perform that action at this time.
0 commit comments