-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.34 KB
/
upload.yaml
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
---
name: Upload files to navigatoruf.org
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
jobs:
upload:
runs-on: self-hosted
timeout-minutes: 4
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 'latest'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build site
run: npm run build && cd dist
- name: Install lftp
run: sudo apt-get install -y lftp sshpass
- name: Upload files to web server
run: |
# We need to connect to the server for lftp to be happy, otherwise it
# hangs on "Connecting...". Connecting will add the host to
# known_hosts.
sshpass -p ${{ secrets.MIL_UFL_SFTP_PASS }} \
sftp -o StrictHostKeyChecking=no \
-P ${{ secrets.MIL_UFL_SFTP_PORT }} [email protected] << EOF
exit
EOF
lftp -u mil,${{ secrets.MIL_UFL_SFTP_PASS }} \
-p ${{ secrets.MIL_UFL_SFTP_PORT }} sftp://mil.ufl.edu << EOF
mirror -c \
--include='.*' \
--exclude='^\..*$' \
--exclude='README.md' \
-R --parallel --verbose \
dist \
navigatoruf/htdocs
exit
EOF