feat: add Gitea Actions CI/CD workflow
This commit is contained in:
34
.gitea/workflows/deploy.yml
Normal file
34
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Build and Deploy AdminApi
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: host
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
docker build -t takeoutsaas-adminapi:latest -f src/Api/TakeoutSaaS.AdminApi/Dockerfile .
|
||||||
|
|
||||||
|
- name: Deploy container
|
||||||
|
run: |
|
||||||
|
docker stop adminapi || true
|
||||||
|
docker rm adminapi || true
|
||||||
|
docker run -d \
|
||||||
|
--name adminapi \
|
||||||
|
--restart unless-stopped \
|
||||||
|
-p 7801:7801 \
|
||||||
|
-e ASPNETCORE_ENVIRONMENT=Production \
|
||||||
|
takeoutsaas-adminapi:latest
|
||||||
|
|
||||||
|
- name: Clean up old images
|
||||||
|
run: |
|
||||||
|
docker image prune -f
|
||||||
Reference in New Issue
Block a user