Simplify repository workflows
All checks were successful
Build / build (push) Successful in 31s

* Use deploy workflow for staging, too
* Reduce deploy.sh script
This commit is contained in:
Tobi Schäfer 2025-05-25 17:00:10 +02:00
parent f6668636a9
commit 3f2bf9c3dc
Signed by: tobi
GPG key ID: 91FAE6FE2EBAC4C8
3 changed files with 26 additions and 83 deletions

View file

@ -1,6 +1,6 @@
name: Deploy (Production)
name: Deploy
on:
on:
workflow_dispatch:
inputs:
hostname:
@ -10,9 +10,30 @@ on:
default: antville.org
jobs:
deploy:
stage:
runs-on: antville
environment:
name: production
url: ${{ inputs.hostname }}
steps:
- name: Copy files to production server
run: ssh ${{ inputs.hostname }} deploy-helma
- 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

View file

@ -1,39 +0,0 @@
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