add workflows

This commit is contained in:
Stanislaw
2022-06-15 22:28:18 +02:00
parent ffc034dbdd
commit 089e13b9ff
8 changed files with 102 additions and 43 deletions

19
.github/workflows/deploy.yaml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Deploy
on:
push:
branches: ["canary"]
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Build image
run: docker build -t ${{ github.repository }} .
- name: Deploy image
run: |
docker stop ${{ github.event.repository.name }} || true
docker rm ${{ github.event.repository.name }} || true
docker run -d -e "DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }}" -e "DATABASE_URL=${{ secrets.DATABASE_URL }}" --restart always --name ${{ github.event.repository.name }} ${{ github.repository }}