Restructure nvim sandbox into "devcube" IDE with zellij + workmux #2
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
| # Build and publish the devcube container image | |
| # Triggered on changes to the baked dot_files configs or manual dispatch | |
| # Image published to: ghcr.io/binarypie-dev/devcube:latest | |
| name: Build devcube Image | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| # Configs are baked into the image, so any config change must rebuild. | |
| - 'dot_files/devcube/**' | |
| - 'dot_files/nvim/**' | |
| - 'dot_files/fish/**' | |
| - 'dot_files/starship/**' | |
| - 'dot_files/zellij/**' | |
| - 'dot_files/workmux/**' | |
| - '.github/workflows/build-devcube.yml' | |
| pull_request: | |
| paths: | |
| - 'dot_files/devcube/**' | |
| - 'dot_files/nvim/**' | |
| - 'dot_files/fish/**' | |
| - 'dot_files/starship/**' | |
| - 'dot_files/zellij/**' | |
| - 'dot_files/workmux/**' | |
| - '.github/workflows/build-devcube.yml' | |
| workflow_dispatch: | |
| schedule: | |
| # Rebuild daily to get updated packages | |
| - cron: '0 6 * * *' | |
| env: | |
| IMAGE_NAME: devcube | |
| IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} | |
| jobs: | |
| build: | |
| name: build ${{ matrix.display }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest-m | |
| suffix: amd64 | |
| display: x86 | |
| - platform: linux/arm64 | |
| runner: ubuntu-latest-m-arm | |
| suffix: arm64 | |
| display: arm | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Docker (ARM) | |
| if: matrix.suffix == 'arm64' | |
| run: | | |
| curl -fsSL https://get.docker.com | sh | |
| sudo usermod -aG docker $USER | |
| sudo systemctl start docker | |
| sudo chmod 666 /var/run/docker.sock | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Log in to GitHub Container Registry | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest-${{ matrix.suffix }},enable=${{ github.ref == 'refs/heads/main' }} | |
| type=sha,prefix=,suffix=-${{ matrix.suffix }} | |
| type=ref,event=pr,suffix=-${{ matrix.suffix }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: dot_files | |
| file: dot_files/devcube/Containerfile | |
| platforms: ${{ matrix.platform }} | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=${{ matrix.suffix }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.suffix }} | |
| provenance: false | |
| manifest: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create and push manifest | |
| env: | |
| SHORT_SHA: ${{ github.sha }} | |
| run: | | |
| SHORT_SHA=${SHORT_SHA::7} | |
| docker manifest create ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest \ | |
| ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest-amd64 \ | |
| ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest-arm64 | |
| docker manifest push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| # Also create SHA manifest | |
| docker manifest create ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${SHORT_SHA} \ | |
| ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${SHORT_SHA}-amd64 \ | |
| ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${SHORT_SHA}-arm64 | |
| docker manifest push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${SHORT_SHA} | |
| - name: Generate build summary | |
| run: | | |
| echo "## devcube Image Built" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Image:** \`${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest\`" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Usage" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY | |
| echo "ujust devcube-setup # pull image + install the 'devc' wrapper" >> $GITHUB_STEP_SUMMARY | |
| echo "devc # launch the parallel-agent workspace (workmux)" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |