name: Build and publish ORFS images on: push: branches: - master paths: - etc/DependencyInstaller.sh - etc/DockerHelper.sh - .github/workflows/github-actions-publish-docker-images.yml - build_openroad.sh - env.sh - flow/Makefile - docker/Dockerfile.dev - docker/Dockerfile.builder - tools/codespace/scripts/** - tools/codespace/Dockerfile-lxqt permissions: contents: read packages: write jobs: buildCodespaceImage: runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted-ubuntu-26.04' || 'ubuntu-26.04' }} timeout-minutes: 600 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set environment variables run: echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - name: Set up Docker Buildx uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - name: Login to GitHub Container Registry (GHCR) if: github.event_name != 'pull_request' uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: registry: ghcr.io username: gha password: ${{ github.token }} - name: Build and export codespaces image uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 with: context: . push: true tags: ${{ env.IMAGE }}:lxqt file: tools/codespace/Dockerfile-lxqt cache-from: type=registry,ref=${{ env.IMAGE }}:lxqtbuildcache cache-to: type=registry,ref=${{ env.IMAGE }}:lxqtbuildcache buildDependenciesImage: strategy: fail-fast: false matrix: os: [["ubuntu26.04", "ubuntu:26.04"], ["ubuntu24.04", "ubuntu:24.04"]] runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted-ubuntu-26.04' || 'ubuntu-26.04' }} steps: - name: Check out repository code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 1 submodules: recursive - name: Set environment variables run: | echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os[0] }}" >> $GITHUB_ENV - name: Set up Docker Buildx uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - name: Login to GitHub Container Registry (GHCR) if: github.event_name != 'pull_request' uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: registry: ghcr.io username: gha password: ${{ github.token }} - name: Copy OpenROAD installer run: cp tools/OpenROAD/etc/DependencyInstaller.sh etc/InstallerOpenROAD.sh - name: Build and export dependencies image uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 with: context: etc push: true tags: ${{ env.IMAGE_DEPS }}:latest file: docker/Dockerfile.dev build-args: | fromImage=${{ matrix.os[1] }} cache-from: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache cache-to: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache,mode=max buildORFSImage: needs: buildDependenciesImage strategy: fail-fast: false matrix: os: ["ubuntu26.04", "ubuntu24.04"] runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted-ubuntu-26.04' || 'ubuntu-26.04' }} steps: - name: Free Disk Space if: runner.environment == 'github-hosted' uses: jlumbroso/free-disk-space@ceedf095f4ec1a097402bc6bd80831f2e1a6fde6 # v2.0.0 with: tool-cache: false - name: Check out repository code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 1 submodules: recursive - name: Set environment variables run: | echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')/${{ matrix.os }}" >> $GITHUB_ENV echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os }}" >> $GITHUB_ENV echo "NUM_THREADS=$(nproc)" >> $GITHUB_ENV - name: Set up Docker Buildx uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - name: Login to GitHub Container Registry (GHCR) if: github.event_name != 'pull_request' uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: registry: ghcr.io username: gha password: ${{ github.token }} - name: Build and export ORFS image uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 with: context: . push: true tags: ${{ env.IMAGE }}:latest file: docker/Dockerfile.builder build-args: | fromImage=${{ env.IMAGE_DEPS }} numThreads=${{ env.NUM_THREADS }} cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max