CI/CD
This commit is contained in:
20
.github/deploy.yml
vendored
Normal file
20
.github/deploy.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['main']
|
||||||
|
pull_request:
|
||||||
|
branches: ['main']
|
||||||
|
|
||||||
|
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 "REDIS_TOKEN=${{ secrets.REDIS_TOKEN }}" -e "DATABASE_URL=${{ secrets.DATABASE_URL }}" --restart always --network BOT --name ${{ github.event.repository.name }} ${{ github.repository }}
|
||||||
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM node:16.10.0
|
||||||
|
WORKDIR /app
|
||||||
|
COPY ./ ./
|
||||||
|
RUN npm install
|
||||||
|
CMD ["npm", "run", "start"]
|
||||||
Reference in New Issue
Block a user