Skip to content

Commit

Permalink
Add auto-upload workflow for pushing to main
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrxyz committed Aug 31, 2024
1 parent 121d06f commit 53734f3
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Upload files to mil.ufl.edu

# 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: 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='^\..*$' \
-R --parallel --verbose \
. \
htdocs
exit
EOF

0 comments on commit 53734f3

Please sign in to comment.