2021-09-29 11:33:13 -07:00
|
|
|
# This is a basic workflow to help you get started with Actions
|
|
|
|
|
|
|
|
name: CD
|
|
|
|
|
|
|
|
# Controls when the workflow will run
|
|
|
|
on:
|
|
|
|
# Triggers the workflow on push or pull request events but only for the main branch
|
|
|
|
#push:
|
|
|
|
# branches: [ main ]
|
|
|
|
#pull_request:
|
|
|
|
# branches: [ main ]
|
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
|
|
jobs:
|
2021-09-29 11:39:24 -07:00
|
|
|
deploy:
|
2021-09-29 11:33:13 -07:00
|
|
|
name: Deploy to server
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Updating and restarting service on host via SSH
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ${{ secrets.SITE_HOST }}
|
|
|
|
username: ${{ secrets.SITE_USERNAME }}
|
|
|
|
key: ${{ secrets.SITE_KEY }}
|
|
|
|
port: ${{ secrets.SITE_PORT }}
|
|
|
|
script: |
|
|
|
|
cd /root
|
2021-09-29 11:41:10 -07:00
|
|
|
docker pull jafner/5etools-docker:latest
|
2021-09-29 11:33:13 -07:00
|
|
|
docker-compose down
|
|
|
|
docker-compose up -d
|
|
|
|
|
|
|
|
- name: Sending Discord notification
|
|
|
|
env:
|
|
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
|
|
uses: Ilshidur/action-discord@master
|