Files
agologum/.gitea/workflows/deploy-api.yaml
Blitblank 7229e369ae
All checks were successful
Build and Deploy API / build-and-deploy (push) Successful in 9s
secretize jwt secret
2026-03-20 20:52:59 -05:00

45 lines
1.2 KiB
YAML

name: Build and Deploy API
run-name: "${{ gitea.event.head_commit.message }}: Deploy API"
on:
push:
#branches:
# - main
paths:
- "api/**"
- ".gitea/workflows/deploy-api.yaml"
jobs:
build-and-deploy:
runs-on: debian12
container:
image: git.vxbard.net/homeburger/bard-cpp-builder:1.0
steps:
- name: Checkout code
uses: actions/checkout@v3
# needs this in order to push to the registry
- name: Validate Registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.vxbard.net \
-u ${{ secrets.REGISTRY_USERNAME }} \
--password-stdin
- name: Build image
run: |
docker build -t git.vxbard.net/homeburger/agologum-api:latest ./api
- name: Push image
run: |
docker push git.vxbard.net/homeburger/agologum-api:latest
- name: Deploy container
run: |
export POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}
export JWT_SECRET=${{ secrets.JWT_SECRET }}
docker compose -f ./api/docker-compose.prod.yaml pull agologum-api
docker compose -f ./api/docker-compose.prod.yaml up -d --force-recreate agologum-api