Compare commits
	
		
			2 commits
		
	
	
		
			f9bc64d1ed
			...
			29f7ca5ae3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 29f7ca5ae3 | |||
| 3f2bf9c3dc | 
					 3 changed files with 26 additions and 83 deletions
				
			
		
							
								
								
									
										31
									
								
								.github/workflows/deploy.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										31
									
								
								.github/workflows/deploy.yml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										39
									
								
								.github/workflows/stage.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										39
									
								
								.github/workflows/stage.yml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
							
								
								
									
										39
									
								
								src/dist/extras/deploy.sh
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										39
									
								
								src/dist/extras/deploy.sh
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -3,50 +3,11 @@
 | 
			
		|||
# Use this script as forced command of an authorized SSH key:
 | 
			
		||||
# 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
 | 
			
		||||
  ping)
 | 
			
		||||
    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)
 | 
			
		||||
    printf 'Restarting Helma… '
 | 
			
		||||
    sudo /bin/systemctl restart helma
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue