Compare commits
No commits in common. "29f7ca5ae3c9f4c27f7b72c91e8f08d777950d8c" and "f9bc64d1ed4b156948700edb13cc17e4b045ba04" have entirely different histories.
29f7ca5ae3
...
f9bc64d1ed
3 changed files with 83 additions and 26 deletions
31
.github/workflows/deploy.yml
vendored
31
.github/workflows/deploy.yml
vendored
|
@ -1,6 +1,6 @@
|
||||||
name: Deploy
|
name: Deploy (Production)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
hostname:
|
hostname:
|
||||||
|
@ -10,30 +10,9 @@ on:
|
||||||
default: antville.org
|
default: antville.org
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stage:
|
deploy:
|
||||||
runs-on: antville
|
runs-on: antville
|
||||||
|
|
||||||
environment:
|
|
||||||
name: production
|
|
||||||
url: ${{ inputs.hostname }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Copy files to production server
|
||||||
|
run: ssh ${{ inputs.hostname }} deploy-helma
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew installDist
|
|
||||||
|
|
||||||
- name: Copy build files to server
|
|
||||||
run: |
|
|
||||||
rsync ./build/install/helma/ ${{ inputs.hostname }}:./ \
|
|
||||||
--verbose --archive --delete --compress \
|
|
||||||
--filter '+ /bin' \
|
|
||||||
--filter '+ /extras' \
|
|
||||||
--filter '+ /launcher.jar' \
|
|
||||||
--filter '- /lib/ext' \
|
|
||||||
--filter '+ /lib' \
|
|
||||||
--filter '+ /modules' \
|
|
||||||
--filter '- /*'
|
|
||||||
|
|
||||||
- name: Restart Helma
|
|
||||||
run: ssh ${{ inputs.hostname }} restart
|
|
||||||
|
|
39
.github/workflows/stage.yml
vendored
Normal file
39
.github/workflows/stage.yml
vendored
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
name: Deploy (Staging)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
hostname:
|
||||||
|
description: Hostname
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
default: antville.org
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stage:
|
||||||
|
runs-on: antville
|
||||||
|
|
||||||
|
environment:
|
||||||
|
name: stage
|
||||||
|
url: ${{ inputs.hostname }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew installDist
|
||||||
|
|
||||||
|
- name: Copy build files to server
|
||||||
|
run: |
|
||||||
|
rsync ./build/install/helma/ ${{ inputs.hostname }}:./ \
|
||||||
|
--verbose --archive --delete --compress \
|
||||||
|
--filter '+ /bin' \
|
||||||
|
--filter '+ /extras' \
|
||||||
|
--filter '+ /launcher.jar' \
|
||||||
|
--filter '- /lib/ext' \
|
||||||
|
--filter '+ /lib' \
|
||||||
|
--filter '+ /modules' \
|
||||||
|
--filter '- /*'
|
||||||
|
|
||||||
|
- name: Restart Helma
|
||||||
|
run: ssh ${{ inputs.hostname }} restart
|
39
src/dist/extras/deploy.sh
vendored
39
src/dist/extras/deploy.sh
vendored
|
@ -3,11 +3,50 @@
|
||||||
# Use this script as forced command of an authorized SSH key:
|
# Use this script as forced command of an authorized SSH key:
|
||||||
# command="/home/helma/extras/deploy.sh" ssh-ed25519 AAAAC3NzaC…
|
# command="/home/helma/extras/deploy.sh" ssh-ed25519 AAAAC3NzaC…
|
||||||
|
|
||||||
|
# Define HELMA_HOST and ANTVILLE_HOST in this file
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
. "$HOME"/deploy.env
|
||||||
|
|
||||||
case "$SSH_ORIGINAL_COMMAND" in
|
case "$SSH_ORIGINAL_COMMAND" in
|
||||||
ping)
|
ping)
|
||||||
echo pong
|
echo pong
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
deploy-helma)
|
||||||
|
rsync ./ "$HELMA_HOST":./ \
|
||||||
|
--archive --compress --delete --verbose \
|
||||||
|
--filter '+ /bin' \
|
||||||
|
--filter '+ /extras' \
|
||||||
|
--filter '+ /launcher.jar' \
|
||||||
|
--filter '- /lib/ext' \
|
||||||
|
--filter '+ /lib' \
|
||||||
|
--filter '+ /modules' \
|
||||||
|
--filter '- /*'
|
||||||
|
printf 'Restarting Helma on HELMA_host… '
|
||||||
|
ssh "$HELMA_HOST" sudo /bin/systemctl restart helma
|
||||||
|
;;
|
||||||
|
|
||||||
|
deploy-antville)
|
||||||
|
rsync ./apps/antville/ "$ANTVILLE_HOST":./apps/antville/ \
|
||||||
|
--archive --compress --delete --verbose \
|
||||||
|
--filter '+ /claustra' \
|
||||||
|
--filter '+ /code' \
|
||||||
|
--filter '+ /compat' \
|
||||||
|
--filter '+ /i18n' \
|
||||||
|
--filter '+ /lib' \
|
||||||
|
--filter '- /*'
|
||||||
|
rsync ./apps/antville/static/helma/ "$ANTVILLE_HOST":./apps/antville/static/helma/ \
|
||||||
|
--archive --compress --verbose \
|
||||||
|
--filter '+ /fonts' \
|
||||||
|
--filter '+ /formica.html' \
|
||||||
|
--filter '+ /img' \
|
||||||
|
--filter '+ /scripts' \
|
||||||
|
--filter '+ /styles' \
|
||||||
|
--filter '- /*'
|
||||||
|
printf 'Restarting Helma on ANTVILLE_host… '
|
||||||
|
ssh "$ANTVILLE_HOST" sudo /bin/systemctl restart helma
|
||||||
|
;;
|
||||||
|
|
||||||
restart)
|
restart)
|
||||||
printf 'Restarting Helma… '
|
printf 'Restarting Helma… '
|
||||||
sudo /bin/systemctl restart helma
|
sudo /bin/systemctl restart helma
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue