Some checks failed
CI/CD / build-test-deploy (push) Has been cancelled
On every push/PR: run Domain.Tests, then docker compose build to validate the full stack still builds. On push to master: also docker compose up -d to redeploy. COMPOSE_PROJECT_NAME is pinned to ruvdstests so a run from a runner-managed checkout always targets the existing stack/volumes instead of spinning up a duplicate under a different project name.
47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
name: CI/CD
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
# Pinned so every run targets the same project regardless of the runner's
|
|
# checkout path — otherwise `docker compose` would derive the project name
|
|
# from the checkout directory, potentially spinning up a second stack and
|
|
# losing the `pgdata` volume instead of updating the running one.
|
|
env:
|
|
COMPOSE_PROJECT_NAME: ruvdstests
|
|
|
|
jobs:
|
|
build-test-deploy:
|
|
runs-on: host
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
# The runner image ships bare (no Docker CLI, no .NET) — it only has
|
|
# the host's Docker *socket* mounted (DooD), so both are installed
|
|
# fresh each run rather than baking a custom runner image.
|
|
- name: Install Docker CLI and .NET SDK
|
|
shell: bash
|
|
run: |
|
|
apk add --no-cache docker-cli docker-cli-compose bash curl \
|
|
icu-libs krb5-libs libgcc libintl libssl3 libstdc++ zlib ca-certificates
|
|
curl -sSL https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh
|
|
bash dotnet-install.sh --channel 9.0 --install-dir /usr/share/dotnet
|
|
ln -sf /usr/share/dotnet/dotnet /usr/local/bin/dotnet
|
|
|
|
- name: Run Domain unit tests
|
|
shell: bash
|
|
run: dotnet test tests/Domain.Tests/Domain.Tests.fsproj -c Release
|
|
|
|
- name: Build images
|
|
shell: bash
|
|
run: docker compose build
|
|
|
|
- name: Deploy (master only)
|
|
if: github.ref == 'refs/heads/master'
|
|
shell: bash
|
|
run: docker compose up -d
|