-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.64 KB
/
main.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Mabron Publish
on:
push:
branches: [ main ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install deps
run: sudo apt-get install -y wget rsync ssh
# - name: create output
# run: mkdir -p publish
- name: build site
run: chmod +x build.sh && ./build.sh
- name: 'Build Zola'
uses: shalzz/zola-deploy-action@master
env:
BUILD_DIR: .
BUILD_FLAGS: --output-dir publish --base-url https://mabron.de/
BUILD_ONLY: true
# - name: run worker script
# run: |
# wget https://mabron.de/updater/upload.hash.sh -O upload.sh
# chmod +x upload.sh
# cd publish
# ../upload.sh -u "https://mabron.de/updater/" -d "www.mabron.de" -p "" \
# -t ${{ secrets.MABRON_UPDATE_TOKEN }}
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
name: id_rsa
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} # use ssh-keyscan to update these
config: ${{ secrets.SSH_CONFIG }}
if_key_exists: fail
- name: Fix publish permissions
run: |
sudo chown "$(id -u):$(id -g)" -R publish
- name: Load current filters
run: |
cd publish
rsync -rvzm --filter="+ */" --filter="+ .filter" --filter="- *" host:~/webroot/www/ .
- name: "Rsync: Upload changes"
run: |
cd publish
rsync -avz --delete --filter="- .filter" --filter=". .filter" . host:~/webroot/www/