Merge pull request #91 from anibalsolon/enh/suggest-introduction #90
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
tags: | |
- v* | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Deploy | |
uses: easingthemes/ssh-deploy@main | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
ARGS: '-rltgoDzvO --delete' | |
SOURCE: '/' | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
TARGET: ${{ secrets.REMOTE_TARGET }} | |
- name: Restart service | |
uses: appleboy/ssh-action@master | |
env: | |
APP_DISCORD_TOKEN: ${{ secrets.APP_DISCORD_TOKEN }} | |
APP_DISCORD_CLIENT_ID: ${{ secrets.APP_DISCORD_CLIENT_ID }} | |
APP_DISCORD_GUILD_ID: ${{ secrets.APP_DISCORD_GUILD_ID }} | |
APP_HE4RT_TOKEN: ${{ secrets.APP_HE4RT_TOKEN }} | |
APP_HE4RT_URL: ${{ secrets.APP_HE4RT_URL }} | |
APP_APOIASE_SECRET: ${{ secrets.APP_APOIASE_SECRET }} | |
APP_APOIASE_TOKEN: ${{ secrets.APP_APOIASE_TOKEN }} | |
APP_APOIASE_URL: ${{ secrets.APP_APOIASE_URL }} | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
envs: APP_DISCORD_TOKEN,APP_DISCORD_CLIENT_ID,APP_DISCORD_GUILD_ID,APP_HE4RT_TOKEN,APP_HE4RT_URL,APP_APOIASE_TOKEN,APP_APOIASE_URL,APP_APOIASE_SECRET,REMOTE_TARGET | |
script: | | |
echo -e "DISCORD_TOKEN=$APP_DISCORD_TOKEN\nDISCORD_CLIENT_ID=$APP_DISCORD_CLIENT_ID\nDISCORD_GUILD_ID=$APP_DISCORD_GUILD_ID\nHE4RT_TOKEN=$APP_HE4RT_TOKEN\nHE4RT_URL=$APP_HE4RT_URL\nAPOIASE_URL=$APP_APOIASE_URL\nAPOIASE_TOKEN=$APP_APOIASE_TOKEN\nAPOIASE_SECRET=$APP_APOIASE_SECRET" > /home/he4rt/he4rt-bot-next/.env | |
cp .env ./he4rt-bot-next/.env | |
cp firebase_admin.json ./he4rt-bot-next/firebase_admin.json | |
cd ./he4rt-bot-next | |
pnpm run prod | |
echo 'He4rtbot Restarted!' |