Skip to content

Make Docker CORRECTLY terminate #89

Make Docker CORRECTLY terminate

Make Docker CORRECTLY terminate #89

name: Build TriOS ISO (Dev branch)
on:
push:
branches: [ dev ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-trios:
name: Build and Package ISO
runs-on: self-hosted
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up version file and variables
id: vars
shell: bash
run: |
_commit_hash=$(git rev-parse --short HEAD)
_container_name="trios-builder-${_commit_hash}"
echo "${_commit_hash}" > ./Trixie/config/includes.chroot/etc/trios/release
echo "commit_hash=${_commit_hash}" >> "$GITHUB_OUTPUT"
echo "container_name=${_container_name}" >> "$GITHUB_OUTPUT"
mkdir -p ./TriOs_Output
- name: Debug commit hash
run: echo "Commit hash is: ${{ steps.vars.outputs.commit_hash }}"

Check failure on line 34 in .github/workflows/build-trios-trixie-dev.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-trios-trixie-dev.yml

Invalid workflow file

You have an error in your yaml syntax on line 34
- name: Build Docker Image
working-directory: ./builder
run: docker build -t trios-builder .
- name: Run Docker Container (Privileged)
id: run_container
run: |
set -e
docker run -d \
--privileged \
--name "${{ steps.vars.outputs.container_name }}" \
-v "${{ github.workspace }}/Trixie:/TriOs" \
-v "${{ github.workspace }}/TriOs_Output:/TriOs_Output" \
trios-builder
# Attach to container to stream logs (will exit if container stops/fails)
docker logs -f "${{ steps.vars.outputs.container_name }}"
continue-on-error: true
- name: Stop Docker Container (always runs)
if: always()
run: |
docker stop "${{ steps.vars.outputs.container_name }}" 2>/dev/null || true
docker rm "${{ steps.vars.outputs.container_name }}" 2>/dev/null || true
- name: Verify ISO Output
if: success()
run: ls -lh ./TriOs_Output || true
- name: Upload ISO Artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: trios-dev-${{ steps.vars.outputs.commit_hash }}.iso
path: ./TriOs_Output/live-image-amd64.hybrid.iso