Update main.yaml #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Podman Compose demos | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - '.github/workflows/**' | |
| - 'demo/demo-1-basics/**' | |
| - 'demo/demo-2-otel/**' | |
| # --- Folders/Files to EXCLUDE --- | |
| - '!README.md' | |
| - '!docs/*.md' | |
| - '!research/**' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/**' | |
| - 'demo/demo-1-basics/**' | |
| - 'demo/demo-2-otel/**' | |
| # --- Folders/Files to EXCLUDE --- | |
| - '!README.md' | |
| - '!docs/*.md' | |
| - '!research/**' | |
| workflow_dispatch: | |
| jobs: | |
| podman-compose: | |
| runs-on: ubuntu-latest | |
| env: | |
| XDG_RUNTIME_DIR: ${{ github.workspace }}/podman-runtime | |
| TMPDIR: ${{ github.workspace }}/podman-tmp | |
| PODMAN_STORAGE: ${{ github.workspace }}/podman-storage | |
| steps: | |
| # -------------------------------------------------- | |
| # 1️⃣ Checkout (SUBMODULES DISABLED ✅) | |
| # -------------------------------------------------- | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| fetch-depth: 1 | |
| clean: true | |
| # -------------------------------------------------- | |
| # 2️⃣ Free disk space | |
| # -------------------------------------------------- | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
| sudo docker image prune -a -f || true | |
| df -h | |
| # -------------------------------------------------- | |
| # 3️⃣ Install Podman | |
| # -------------------------------------------------- | |
| - name: Install Podman & podman-compose | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y podman uidmap python3-pip | |
| pip install podman-compose | |
| # -------------------------------------------------- | |
| # 4️⃣ Configure Podman runtime | |
| # -------------------------------------------------- | |
| - name: Configure Podman runtime | |
| run: | | |
| mkdir -p ~/.config/containers | |
| cat <<EOF > ~/.config/containers/containers.conf | |
| [engine] | |
| cgroup_manager = "cgroupfs" | |
| runtime = "crun" | |
| events_logger = "file" | |
| systemd = false | |
| log_level = "error" | |
| EOF | |
| # -------------------------------------------------- | |
| # 5️⃣ Configure Podman storage | |
| # -------------------------------------------------- | |
| - name: Configure Podman storage | |
| run: | | |
| mkdir -p "$XDG_RUNTIME_DIR" "$TMPDIR" "$PODMAN_STORAGE" | |
| chmod 700 "$XDG_RUNTIME_DIR" | |
| chmod 777 "$TMPDIR" "$PODMAN_STORAGE" | |
| cat <<EOF > ~/.config/containers/storage.conf | |
| [storage] | |
| driver = "overlay" | |
| graphroot = "$PODMAN_STORAGE" | |
| runroot = "$XDG_RUNTIME_DIR/runroot" | |
| EOF | |
| podman system migrate | |
| # -------------------------------------------------- | |
| # 6️⃣ Cleanup | |
| # -------------------------------------------------- | |
| - name: Cleanup | |
| run: podman system prune -a -f | |
| # ================================================== | |
| # 🔹 DEMO 1 — BASICS | |
| # ================================================== | |
| - name: Create anomaly-network | |
| run: podman network create anomaly-network || true | |
| - name: Run demo-1-basics | |
| working-directory: demo/demo-1-basics | |
| run: | | |
| podman-compose build --no-cache 2>/dev/null | |
| podman-compose up -d 2>/dev/null | |
| echo "✅ demo-1-basics running containers:" | |
| podman ps --format "table {{.Names}}\t{{.Status}}" | |
| podman-compose down -v 2>/dev/null | |
| - run: podman system prune -a -f | |
| # ================================================== | |
| # 🔹 DEMO 2 — OTEL | |
| # ================================================== | |
| - name: Create edge-network | |
| run: podman network create edge-network || true | |
| - name: Run demo-2-otel | |
| working-directory: demo/demo-2-otel | |
| run: | | |
| podman-compose build --no-cache 2>/dev/null | |
| podman-compose up -d 2>/dev/null | |
| echo "✅ demo-2-otel running containers:" | |
| podman ps --format "table {{.Names}}\t{{.Status}}" | |
| # -------------------------------------------------- | |
| # 7️⃣ Final cleanup | |
| # -------------------------------------------------- | |
| - name: Final cleanup | |
| if: always() | |
| run: podman system prune -a -f |