diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index da0f690c..254d9892 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -1,10 +1,13 @@ -name: Deploy to Antville.org development environment +name: Staging on: workflow_dispatch +env: + SSH_AUTH_SOCK: /tmp/ssh-agent.sock + jobs: - build: + install: runs-on: ubuntu-latest environment: @@ -25,3 +28,23 @@ jobs: - name: Build with Gradle run: ./gradlew installDist + + - name: Set up SSH agent + run: | + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" + mkdir -p ~/.ssh + echo '${{ vars.SSH_CONFIG }}' > ~/.ssh/config + echo '${{ vars.KNOWN_HOSTS }}' > ~/.ssh/known_hosts + + - name: Publish to staging server + run: | + rsync build/install/helma/ antville.dev:/ \ + --verbose --archive --delete --compress \ + --filter '+ launcher.jar' \ + --filter '+ lib' \ + --filter '+ *.jar' \ + --filter '- *' \ + + - name: Restart Helma + run: ssh antville.dev restart