This commit is contained in:
34
.gitea/workflows/deploy.yml
Normal file
34
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Deploy Smart Search Backend
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t smart-search-backend:latest .
|
||||
|
||||
- name: Stop old container
|
||||
run: |
|
||||
docker stop smart-search-backend || true
|
||||
docker rm smart-search-backend || true
|
||||
|
||||
- name: Run new container
|
||||
run: |
|
||||
docker run -d \
|
||||
--name smart-search-backend \
|
||||
--restart always \
|
||||
-p 127.0.0.1:9091:9091 \
|
||||
smart-search-backend:latest
|
||||
|
||||
- name: Cleanup old images
|
||||
run: |
|
||||
docker image prune -f
|
||||
Reference in New Issue
Block a user