Some checks failed
Build and Deploy API / build-and-deploy (push) Failing after 7s
44 lines
1.2 KiB
YAML
44 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 }}
|
|
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
|