Image Pipeline Playground
ci: add Electron desktop and Docker image workflows
Mohammad Rajaei74ca9937dae3
diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.ymlnew file mode 100644index 0000000..b32e56b--- /dev/null+++ b/.github/workflows/desktop.yml@@ -0,0 +1,113 @@+name: Desktop++on:+ push:+ branches: [main]+ tags: ["v*"]+ pull_request:+ branches: [main]+ workflow_dispatch:++concurrency:+ group: desktop-${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true++jobs:+ build:+ name: Build (${{ matrix.artifact }})+ runs-on: ${{ matrix.os }}+ timeout-minutes: 120+ strategy:+ fail-fast: false+ matrix:+ include:+ - os: windows-latest+ artifact: windows+ - os: ubuntu-22.04+ artifact: linux+ - os: macos-latest+ artifact: macos++ steps:+ - name: Checkout+ uses: actions/checkout@v4++ - name: Setup Node.js+ uses: actions/setup-node@v4+ with:+ node-version: "22"+ cache: npm+ cache-dependency-path: |+ frontend/package-lock.json+ desktop/package-lock.json++ - name: Setup Python+ uses: actions/setup-python@v5+ with:+ python-version: "3.11"++ - name: Setup uv+ uses: astral-sh/setup-uv@v6+ with:+ enable-cache: true+ cache-dependency-glob: backend/uv.lock++ - name: Install Linux packaging dependencies+ if: runner.os == 'Linux'+ run: |+ sudo apt-get update+ sudo apt-get install -y --no-install-recommends \+ libgtk-3-0 \+ libnotify4 \+ libnss3 \+ libxss1 \+ libxtst6 \+ xdg-utils \+ libatspi2.0-0 \+ libsecret-1-0 \+ libfuse2 \+ rpm++ - name: Build desktop app+ env:+ CI: "true"+ CSC_IDENTITY_AUTO_DISCOVERY: "false"+ # electron-builder may use this for GitHub publishing metadata+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}+ run: node scripts/build-desktop.mjs++ - name: Upload installers+ uses: actions/upload-artifact@v4+ with:+ name: ImagePipes-${{ matrix.artifact }}-${{ github.sha }}+ path: |+ desktop/release/*.exe+ desktop/release/*.dmg+ desktop/release/*.AppImage+ desktop/release/*.zip+ desktop/release/*.blockmap+ desktop/release/latest*.yml+ if-no-files-found: error+ retention-days: 14++ release:+ name: Publish GitHub Release+ if: startsWith(github.ref, 'refs/tags/v')+ needs: build+ runs-on: ubuntu-latest+ permissions:+ contents: write+ steps:+ - name: Download build artifacts+ uses: actions/download-artifact@v4+ with:+ path: artifacts+ pattern: ImagePipes-*+ merge-multiple: true++ - name: Create GitHub Release+ uses: softprops/action-gh-release@v2+ with:+ files: artifacts/**+ generate_release_notes: true+ fail_on_unmatched_files: truediff --git a/.github/workflows/docker.yml b/.github/workflows/docker.ymlnew file mode 100644index 0000000..8eafdb1--- /dev/null+++ b/.github/workflows/docker.yml@@ -0,0 +1,66 @@+name: Docker++on:+ push:+ branches: [main]+ paths:+ - "Dockerfile"+ - "docker-compose.yml"+ - ".dockerignore"+ - "frontend/**"+ - "backend/**"+ - ".github/workflows/docker.yml"+ pull_request:+ branches: [main]+ paths:+ - "Dockerfile"+ - "docker-compose.yml"+ - ".dockerignore"+ - "frontend/**"+ - "backend/**"+ - ".github/workflows/docker.yml"+ workflow_dispatch:++concurrency:+ group: docker-${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true++jobs:+ build:+ name: Build image+ runs-on: ubuntu-latest+ timeout-minutes: 45+ steps:+ - name: Checkout+ uses: actions/checkout@v4++ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build+ uses: docker/build-push-action@v6+ with:+ context: .+ file: ./Dockerfile+ push: false+ load: true+ tags: image-pipes:ci+ cache-from: type=gha+ cache-to: type=gha,mode=max++ - name: Smoke health check+ run: |+ docker run -d --name image-pipes-ci -p 8000:8000 image-pipes:ci+ for i in $(seq 1 30); do+ if curl -fsS http://127.0.0.1:8000/api/health; then+ echo+ docker logs image-pipes-ci+ docker rm -f image-pipes-ci+ exit 0+ fi+ sleep 2+ done+ echo "Health check failed"+ docker logs image-pipes-ci || true+ docker rm -f image-pipes-ci || true+ exit 1