| 1 |
sysadm |
1.1 |
name: Docker Image CI
|
| 2 |
|
|
|
| 3 |
|
|
on:
|
| 4 |
|
|
push:
|
| 5 |
|
|
branches: [ "main" ]
|
| 6 |
|
|
pull_request:
|
| 7 |
|
|
branches: [ "main" ]
|
| 8 |
|
|
|
| 9 |
|
|
jobs:
|
| 10 |
|
|
|
| 11 |
|
|
build:
|
| 12 |
|
|
|
| 13 |
|
|
runs-on: ubuntu-latest
|
| 14 |
|
|
|
| 15 |
|
|
steps:
|
| 16 |
|
|
- name: Checkout repository and submodules
|
| 17 |
|
|
uses: actions/checkout@v4
|
| 18 |
|
|
with:
|
| 19 |
|
|
submodules: recursive
|
| 20 |
|
|
fetch-depth: 0 # fetch all history if the action needs it
|
| 21 |
|
|
|
| 22 |
sysadm |
1.2 |
- name: Build and run the stack
|
| 23 |
|
|
# Build images and run containers in detached mode
|
| 24 |
|
|
run: docker compose up --build -d --wait --wait-timeout 60
|
| 25 |
|
|
|
| 26 |
|
|
- name: Display app version
|
| 27 |
|
|
# Execute tests inside one of the running containers
|
| 28 |
|
|
run: docker compose exec bbsd /usr/local/lbbs/bin/bbsd -v
|
| 29 |
|
|
|
| 30 |
|
|
- name: Clean up
|
| 31 |
|
|
# Stop and remove all containers, networks, and volumes
|
| 32 |
|
|
run: docker compose down
|
| 33 |
|
|
if: always() # Ensure cleanup runs even if tests fail
|