File tree Expand file tree Collapse file tree 1 file changed +30
-14
lines changed Expand file tree Collapse file tree 1 file changed +30
-14
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
6
- runs-on : ubuntu-latest
7
- 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 ios.md https://raw.githubusercontent.com/dansl/iOS-Stuff/refs/heads/main/README.md && git commit -a -m "updated ios.md" && git push
9
+ update-file :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
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 README.md target-repo/pages/ios.md
20
+
21
+ cd target-repo
22
+ git config user.email "[email protected] "
23
+ git config user.name "dansl"
24
+
25
+ if ! git diff --quiet -- pages/ios.md; then
26
+ git add pages/ios.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