Merge pull request #707 from underworldcode/feature/integration-point… #143
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: "GHCR: Command-Line Container" | |
| # Builds the Underworld3 command-line Docker image and pushes to GHCR. | |
| # Uses container/Containerfile (pixi-based two-stage image for local use). | |
| # | |
| # This is separate from binder-image.yml which builds Binder-ready images | |
| # optimized for mybinder.org. | |
| on: | |
| push: | |
| branches: [main, development] | |
| paths: | |
| # Only rebuild when these files change | |
| - 'container/Containerfile' | |
| - 'pixi.toml' | |
| - 'pixi.lock' | |
| - 'src/**/*.pyx' | |
| - 'src/**/*.c' | |
| - 'setup.py' | |
| - 'pyproject.toml' | |
| workflow_dispatch: | |
| inputs: | |
| force_rebuild: | |
| description: 'Force full rebuild (no cache)' | |
| type: boolean | |
| default: false | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| actions: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| #- name: Extract branch name | |
| # run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/underworldcode/underworld3 | |
| tags: | | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| file: container/Containerfile | |
| platforms: linux/amd64,linux/arm64 | |
| no-cache: ${{ inputs.force_rebuild || false }} | |
| build-args: | | |
| SETUPTOOLS_SCM_PRETEND_VERSION=${{ steps.meta.outputs.version }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # tags: | | |
| # ghcr.io/underworldcode/underworld3:${{ env.BRANCH }} | |
| # ghcr.io/underworldcode/underworld3:latest |