Skip to content
Latchkey

CI - Workspace Image workflow (GACWR/OpenUBA)

The CI - Workspace Image workflow from GACWR/OpenUBA, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: GACWR/OpenUBA.github/workflows/ci-workspace.ymlLicense Apache-2.0View source

What it does

This is the CI - Workspace Image workflow from the GACWR/OpenUBA repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: CI - Workspace Image

on:
  push:
    branches: [master, dev/workspaces]
    paths:
      - 'docker/workspace/**'
      - 'sdk/**'
      - 'workspace/**'
  pull_request:
    branches: [master]
    paths:
      - 'docker/workspace/**'
      - 'sdk/**'
      - 'workspace/**'

jobs:
  build-workspace:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Build workspace image
        uses: docker/build-push-action@v5
        with:
          context: .
          file: docker/workspace/Dockerfile
          push: false
          load: true
          tags: openuba-workspace:latest
          cache-from: type=gha
          cache-to: type=gha,mode=max

      - name: Test workspace image starts
        run: |
          docker run --rm -d --name ws-test -p 8888:8888 openuba-workspace:latest
          sleep 10
          curl -sf http://localhost:8888/api || echo "JupyterLab not ready yet (expected in CI)"
          docker stop ws-test

  publish-workspace:
    needs: build-workspace
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/master' && github.event_name == 'push'
    steps:
      - uses: actions/checkout@v4

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Build and push
        uses: docker/build-push-action@v5
        with:
          context: .
          file: docker/workspace/Dockerfile
          push: true
          tags: |
            gacwr/openuba-workspace:latest
            gacwr/openuba-workspace:${{ github.sha }}
          cache-from: type=gha
          cache-to: type=gha,mode=max

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: CI - Workspace Image
 
on:
  push:
    branches: [master, dev/workspaces]
    paths:
      - 'docker/workspace/**'
      - 'sdk/**'
      - 'workspace/**'
  pull_request:
    branches: [master]
    paths:
      - 'docker/workspace/**'
      - 'sdk/**'
      - 'workspace/**'
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  build-workspace:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v4
 
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
 
      - name: Build workspace image
        uses: docker/build-push-action@v5
        with:
          context: .
          file: docker/workspace/Dockerfile
          push: false
          load: true
          tags: openuba-workspace:latest
          cache-from: type=gha
          cache-to: type=gha,mode=max
 
      - name: Test workspace image starts
        run: |
          docker run --rm -d --name ws-test -p 8888:8888 openuba-workspace:latest
          sleep 10
          curl -sf http://localhost:8888/api || echo "JupyterLab not ready yet (expected in CI)"
          docker stop ws-test
 
  publish-workspace:
    timeout-minutes: 30
    needs: build-workspace
    runs-on: latchkey-small
    if: github.ref == 'refs/heads/master' && github.event_name == 'push'
    steps:
      - uses: actions/checkout@v4
 
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
 
      - name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
 
      - name: Build and push
        uses: docker/build-push-action@v5
        with:
          context: .
          file: docker/workspace/Dockerfile
          push: true
          tags: |
            gacwr/openuba-workspace:latest
            gacwr/openuba-workspace:${{ github.sha }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
 

What changed

3 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

This workflow runs 2 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow