Updated release workflow. Added docker compose for the API.
Some checks failed
Some checks failed
This commit is contained in:
@@ -95,3 +95,35 @@ jobs:
|
||||
"prerelease": ${GITHUB_REF_NAME##*-rc*:+false}${GITHUB_REF_NAME##*-rc*:-true}
|
||||
}
|
||||
JSON
|
||||
|
||||
deploy-api:
|
||||
name: Deploy API (Production)
|
||||
needs: build-and-publish-image
|
||||
runs-on: [self-hosted, linux, x64, docker] # your Synology runner
|
||||
environment: production # optional: add env protection rules in Gitea
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Docker login (pull private image)
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_PASSWORD }}" \
|
||||
| docker login "${{ secrets.REGISTRY_HOST }}" \
|
||||
-u "${{ secrets.REGISTRY_USER }}" \
|
||||
--password-stdin
|
||||
|
||||
- name: Render env file for compose
|
||||
run: |
|
||||
mkdir -p deploy
|
||||
cat > deploy/.env <<EOF
|
||||
REGISTRY=${{ secrets.REGISTRY_HOST }}
|
||||
IMAGE_NS=${{ github.repository }}
|
||||
TAG=${GITHUB_REF_NAME}
|
||||
DB_CONN=${{ secrets.DB_CONNECTION_STRING }}
|
||||
ALLOWED_ORIGINS=${{ secrets.ALLOWED_ORIGINS }}
|
||||
TZ=America/Detroit
|
||||
EOF
|
||||
|
||||
- name: Deploy (pull & up -d)
|
||||
run: |
|
||||
docker compose -f deploy/docker-compose.api.yml --env-file deploy/.env pull
|
||||
docker compose -f deploy/docker-compose.api.yml --env-file deploy/.env up -d
|
||||
|
||||
Reference in New Issue
Block a user