This commit is contained in:
parent
892ad6a5b0
commit
4331207e6e
38
.gitea/workflows/deploy.yml
Normal file
38
.gitea/workflows/deploy.yml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
name: Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["master"]
|
||||||
|
paths: [".gitea/workflows/deploy-api.yml", "API/**", "!API/README.md"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
java-version: ["17"]
|
||||||
|
maven-version: ["3.8.5"]
|
||||||
|
runs-on: "ubuntu-latest"
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: "./API"
|
||||||
|
|
||||||
|
# Steps to run
|
||||||
|
steps:
|
||||||
|
# Checkout the repo
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Setup Java and Maven
|
||||||
|
- name: Set up JDK and Maven
|
||||||
|
uses: s4u/setup-maven-action@v1.12.0
|
||||||
|
with:
|
||||||
|
java-version: ${{ matrix.java-version }}
|
||||||
|
distribution: "zulu"
|
||||||
|
maven-version: ${{ matrix.maven-version }}
|
||||||
|
|
||||||
|
# Deploy to Dokku
|
||||||
|
- name: Deploy to Dokku
|
||||||
|
uses: dokku/github-action@master
|
||||||
|
with:
|
||||||
|
git_remote_url: "ssh://dokku@10.10.3.28:22/textpurify-api"
|
||||||
|
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
@ -0,0 +1,13 @@
|
|||||||
|
package me.braydon.profanity.notification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A source that can receive notifications.
|
||||||
|
*
|
||||||
|
* @author Braydon
|
||||||
|
*/
|
||||||
|
public abstract class NotificationSource {
|
||||||
|
/**
|
||||||
|
* Send an alert to this notification source.
|
||||||
|
*/
|
||||||
|
public abstract void alert();
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package me.braydon.profanity.notification.impl;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import me.braydon.profanity.notification.NotificationSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A notification source that
|
||||||
|
* sends alerts to a Discord webhook.
|
||||||
|
*
|
||||||
|
* @author Braydon
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
public final class DiscordSource extends NotificationSource {
|
||||||
|
/**
|
||||||
|
* The URL of the webhook to send alerts to.
|
||||||
|
*/
|
||||||
|
@NonNull private final String webhookUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send an alert to this notification source.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void alert() {}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user