Skip to content

Commit

Permalink
Added GitHub Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CdeJong committed Jul 9, 2024
1 parent 54d6c5d commit c24849d
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Deploy

on:
push:
branches:
- development-1.19.4

jobs:
build_and_deploy:
if: github.repository_owner == 'onestorm-net'
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout repository
uses: actions/checkout@v4
- name: JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: 'maven'

# Build
- name: Build with Maven
run: mvn -U -B -e clean package deploy
# -U: --update-snapshots
# -B: Runs Maven in non-interactive (batch) mode
# -e: Displays Maven execution errors only

# Deploy
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOST }}
- name: Rsync deploy mvn repo
run: rsync -r --quiet target/mvn-repo/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/web/www/repo.onestorm.net/public/repository/maven-public/
- name: Rsync deploy final artifact
run: rsync -r --quiet --mkpath target/AreaShopAddon-*.jar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/web/www/repo.onestorm.net/public/downloads/AreaShopAddon/

0 comments on commit c24849d

Please sign in to comment.