Skip to content

Merge pull request #91 from anibalsolon/enh/suggest-introduction #90

Merge pull request #91 from anibalsolon/enh/suggest-introduction

Merge pull request #91 from anibalsolon/enh/suggest-introduction #90

Workflow file for this run

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!'