BaseBandRewrite/.forgejo/workflows/build-server.yml
2024-06-12 13:31:00 +02:00

56 lines
1.6 KiB
YAML

on:
workflow_dispatch:
push:
branches-ignore:
- "!release"
paths:
- ".forgejo/workflows/build-server.yml"
- "Server/**"
- "Discord/**"
jobs:
make:
name: Build BaseBand Server
runs-on: 'docker'
steps:
- name: Setup Java
uses: https://github.com/actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 8
- name: Checkout
uses: actions/checkout@v4
- name: Notify Action Start
run: bash scripts/webhook.sh "**(Server)** Build Action Started at"
- name: Initialize Gradle
uses: https://github.com/gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew --no-daemon Server:build Discord:build
- name: Upload Server
continue-on-error: true
uses: forgejo/upload-artifact@v4
with:
name: BaseBand-Server.jar
path: Server/build/libs/BaseBand-Server.jar
- name: Upload Bot
continue-on-error: true
uses: forgejo/upload-artifact@v4
with:
name: BaseBand-Discord.jar
path: Discord/build/libs/BaseBand-Discord.jar
- name: Push to Prod Server
env:
SSH_PRIVATEKEY: ${{ secrets.SSH_PRIVATEKEY }}
GPG_PRIVATEKEY: ${{ secrets.GPG_PRIVATEKEY }}
BB_HOST: ${{ vars.BB_HOST }}
BB_PORT: ${{ vars.BB_PORT }}
BB_PATH: ${{ vars.BB_PATH }}
run: |
bash scripts/push_file.sh Server/build/libs/BaseBand-Server.jar
bash scripts/push_file.sh Discord/build/libs/BaseBand-Discord.jar
- name: Notify Action Completion
if: always()
run: bash scripts/webhook.sh "**(Server)** Build Action Completed"