main
This commit is contained in:
43
.github/workflows/deploy.yml
vendored
Normal file
43
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Deploy Backend
|
||||
run-name: ${{ gitea.actor }} is deploying backend 🚀
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
run: |
|
||||
docker build -t skript-be .
|
||||
|
||||
- name: Stop and Remove Existing Container
|
||||
run: |
|
||||
docker stop backend-skript-container || true
|
||||
docker rm backend-skript-container || true
|
||||
|
||||
- name: Run New Container
|
||||
run: |
|
||||
docker run -d \
|
||||
--name backend-skript-container \
|
||||
--restart unless-stopped \
|
||||
--network gitea-server_gitea \
|
||||
-p 1806:3000 \
|
||||
-e DATABASE_URL='${{ secrets.DATABASE_URL }}' \
|
||||
-e JWT_SECRET='${{ secrets.JWT_SECRET }}' \
|
||||
-e REDIS_HOST='redis' \
|
||||
-e REDIS_PORT='6379' \
|
||||
skript-be
|
||||
|
||||
- name: Cleanup
|
||||
run: docker image prune -f
|
||||
Reference in New Issue
Block a user