feat(export): lit GLB materials option, default lit (#1321) (#1322) #418
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
| # This Source Code Form is subject to the terms of the Mozilla Public | |
| # License, v. 2.0. If a copy of the MPL was not distributed with this | |
| # file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
| name: Docker Image | |
| on: | |
| release: | |
| types: | |
| - published | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/docker.yml' | |
| - '.cargo/**' | |
| - 'Cargo.lock' | |
| - 'Cargo.toml' | |
| - 'apps/server/**' | |
| - 'rust/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| # A newer push to main supersedes an in-flight image build — cancel the older | |
| # run rather than queueing behind it, so a slow/hung build can't jam the | |
| # queue (as happened when #874's large Rust diff cache-busted the build and a | |
| # later commit's run sat pending behind it). | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository_owner }}/ifc-lite-server | |
| jobs: | |
| docker: | |
| name: Build & Push Docker Image | |
| runs-on: depot-ubuntu-24.04-4 | |
| # Cap a stuck "Build and push" so it can't run to GitHub's 6h default. | |
| # A *cold* build — cargo-chef cooking the whole workspace after a | |
| # deps-cache miss — is the long pole, and a cold build that gets cancelled | |
| # never warms the gha cache, so the cap must let one complete. 120 covers | |
| # a cold build; warm builds finish in minutes. | |
| timeout-minutes: 120 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| lfs: false | |
| persist-credentials: false | |
| # QEMU is only needed to emulate the non-native arm64 build, which we | |
| # now only do on `release: published` (see the `platforms` expression | |
| # below). Skipping it on main pushes shaves setup time off the frequent | |
| # amd64-only builds. | |
| - name: Set up QEMU | |
| if: github.event_name == 'release' | |
| uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) | |
| id: meta | |
| uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| # tag release as version (e.g. 0.5.0) | |
| type=match,pattern=v(.*),group=1,event=tag | |
| # tag release also as latest | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=raw,value=latest,event=tag | |
| # sha for push-to-main builds | |
| type=sha,prefix=,event=branch | |
| - name: Build and push | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 | |
| with: | |
| context: . | |
| file: apps/server/Dockerfile | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: | | |
| ${{ steps.meta.outputs.labels }} | |
| org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
| cache-from: type=gha | |
| # mode=max keeps the cargo-chef "cooked deps" stage in the cache — | |
| # that layer is what makes warm builds finish in minutes instead of | |
| # recompiling the whole workspace, so dropping to mode=min would | |
| # *raise* compute minutes. | |
| cache-to: type=gha,mode=max | |
| # Build arm64 only for actual releases (distribution images). On the | |
| # frequent push-to-main builds (~1/3 of commits touch rust/** and | |
| # trigger this workflow) we build amd64 only — the arm64 leg runs | |
| # under slow QEMU emulation and doubled both build time AND the gha | |
| # cache that drives Depot's per-GB storage bill. The `latest`/sha | |
| # main images stay amd64; multi-arch manifests ship on release. | |
| platforms: ${{ github.event_name == 'release' && 'linux/amd64,linux/arm64' || 'linux/amd64' }} |