This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
Merge pull request #17 from TurnipTales/develop #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
release: | |
name: 🎉 Release TurnipTales Discord Bot | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
- name: Set application properties | |
env: | |
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }} | |
run: | | |
echo "discord.bot.token=$DISCORD_BOT_TOKEN" >> src/main/resources/application.properties | |
- name: Build with Maven | |
run: mvn -B test package --file pom.xml | |
- if: github.event_name == 'push' | |
name: Upload via SCP | |
uses: appleboy/[email protected] | |
with: | |
host: turniptales.net | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
port: 22 | |
source: "target/turniptales-discord.jar" | |
target: "/home/discord" | |
timeout: 120s | |
strip_components: 1 | |
- if: github.event_name == 'push' | |
name: Restart TurnipTales API | |
uses: appleboy/[email protected] | |
with: | |
host: turniptales.net | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
port: 22 | |
script: | | |
cd /home/discord | |
chown -R root:root turniptales-discord.jar | |
./run.sh |