This commit is contained in:
33
.gitea/workflows/deploy.yml
Normal file
33
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Deploy to Production
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- prod
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: [docker:host]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t olaper:latest .
|
||||
|
||||
- name: Stop old container (if running)
|
||||
run: |
|
||||
if [ "$(docker ps -q -f name=olaper)" ]; then
|
||||
docker stop olaper && docker rm olaper
|
||||
fi
|
||||
|
||||
- name: Run new container
|
||||
run: |
|
||||
docker run -d \
|
||||
--name olaper \
|
||||
--restart always \
|
||||
-p 5005:5005 \
|
||||
-e SECRET_KEY=${{ secrets.SECRET_KEY }} \
|
||||
-e ENCRYPTION_KEY=${{ secrets.ENCRYPTION_KEY }} \
|
||||
olaper:latest
|
||||
Reference in New Issue
Block a user