feat: add AI Troubleshoot feature for Conductor OSS and ConflixIQ Studio #18
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: Build Docker & Windows | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - copilot/** | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-and-push: | |
| name: Build and Push Docker Image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get version from package.json | |
| id: package-version | |
| run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Container Registry | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=tag | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=sha,prefix=sha- | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=raw,value=${{ steps.package-version.outputs.version }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| build-windows: | |
| name: Build Windows Executable | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| shell: powershell | |
| run: | | |
| if (Test-Path node_modules) { Remove-Item -Recurse -Force node_modules } | |
| npm install | |
| - name: Type check | |
| run: npm run type-check | |
| - name: Build web application | |
| run: npm run build | |
| - name: Build Windows executable | |
| run: npm run sea:build:windows | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=4096 | |
| - name: List release artifacts | |
| shell: powershell | |
| run: | | |
| Write-Host "Checking dist/release folder..." | |
| if (Test-Path "dist/release") { | |
| Write-Host "Contents of dist/release:" | |
| Get-ChildItem -Path "dist/release" -File | ForEach-Object { | |
| Write-Host " - $($_.Name) ($([math]::Round($_.Length/1MB, 2)) MB)" | |
| } | |
| } else { | |
| Write-Host "dist/release folder does not exist!" | |
| exit 1 | |
| } | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-builds | |
| path: | | |
| dist/release/*.exe | |
| dist/release/*.zip | |
| if-no-files-found: warn | |
| retention-days: 30 | |
| - name: Create Release (on tag only) | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| dist/release/*.exe | |
| dist/release/*.zip | |
| draft: true | |
| prerelease: false | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| export-tar: | |
| name: Export Docker Image as TAR | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get version from package.json | |
| id: package-version | |
| run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: | | |
| rm -rf node_modules package-lock.json | |
| npm install | |
| - name: Type check | |
| run: npm run type-check | |
| - name: Build web application | |
| run: npm run build | |
| - name: Build Docker image with SEA builder | |
| run: npm run sea:build:docker | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=4096 | |
| - name: List release artifacts | |
| run: | | |
| echo "Checking dist/release folder..." | |
| if [ -d "dist/release" ]; then | |
| echo "Contents of dist/release:" | |
| ls -lh dist/release/ | |
| else | |
| echo "dist/release folder does not exist!" | |
| exit 1 | |
| fi | |
| - name: Upload Docker TAR artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docker-image-tar | |
| path: dist/release/*.tar | |
| if-no-files-found: warn | |
| retention-days: 30 | |
| - name: Create Release with Docker TAR (on tag only) | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: dist/release/*.tar | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |