2024-04-10 08:53:58 +00:00
|
|
|
name: Deploy App
|
2024-04-06 04:55:48 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-04-10 08:53:58 +00:00
|
|
|
branches: ["master"]
|
|
|
|
paths-ignore:
|
|
|
|
- .gitignore
|
|
|
|
- README.md
|
|
|
|
- LICENSE
|
|
|
|
- docker-compose.yml
|
2024-04-06 04:55:48 +00:00
|
|
|
|
|
|
|
jobs:
|
2024-04-10 08:53:58 +00:00
|
|
|
docker:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch: ["ubuntu-latest"]
|
|
|
|
git-version: ["2.44.0"]
|
|
|
|
java-version: ["17"]
|
|
|
|
maven-version: ["3.8.5"]
|
|
|
|
runs-on: ${{ matrix.arch }}
|
|
|
|
|
|
|
|
# Steps to run
|
2024-04-06 04:55:48 +00:00
|
|
|
steps:
|
2024-04-10 08:53:58 +00:00
|
|
|
# Checkout the repo
|
|
|
|
- name: Checkout
|
2024-04-06 04:55:48 +00:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-04-10 08:53:58 +00:00
|
|
|
# Setup Java and Maven
|
|
|
|
- name: Set up JDK and Maven
|
2024-06-29 08:00:30 +00:00
|
|
|
uses: s4u/setup-maven-action@v1.14.0
|
2024-04-08 06:20:25 +00:00
|
|
|
with:
|
2024-04-10 08:53:58 +00:00
|
|
|
java-version: ${{ matrix.java-version }}
|
|
|
|
distribution: "zulu"
|
|
|
|
maven-version: ${{ matrix.maven-version }}
|
2024-04-08 06:20:25 +00:00
|
|
|
|
2024-04-10 08:53:58 +00:00
|
|
|
# Run JUnit Tests
|
2024-04-08 06:20:25 +00:00
|
|
|
- name: Run Tests
|
2024-04-08 06:33:14 +00:00
|
|
|
run: mvn --batch-mode test -q
|
2024-04-08 06:20:25 +00:00
|
|
|
|
2024-04-10 08:53:58 +00:00
|
|
|
# Re-checkout to reset the FS before deploying to Dokku
|
|
|
|
- name: Checkout - Reset FS
|
2024-04-08 19:01:06 +00:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2024-04-10 08:53:58 +00:00
|
|
|
# Deploy to Dokku
|
2024-04-06 04:55:48 +00:00
|
|
|
- name: Push to dokku
|
|
|
|
uses: dokku/github-action@master
|
|
|
|
with:
|
2024-04-06 18:33:29 +00:00
|
|
|
git_remote_url: "ssh://dokku@10.0.50.137:22/minecraft-helper"
|
2024-04-06 04:55:48 +00:00
|
|
|
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|