DockerBuild.NotebookImage #33
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: DockerBuild.NotebookImage | |
| permissions: | |
| contents: read | |
| packages: write | |
| on: | |
| # allow it to be run on-demand | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version of ArcGIS API for Python to install in the image" | |
| type: string | |
| default: "2.4.2" | |
| arcgis_mapping_version: | |
| description: "Version of arcgis-mapping to install in the image (only used if version >= 2.4.0)" | |
| type: string | |
| default: "4.33.0" | |
| python_version: | |
| description: "Python version to base image on" | |
| type: string | |
| default: "3.13" | |
| is_latest_release: | |
| description: "Version of ArcGIS API for Python is Latest current release" | |
| type: boolean | |
| default: false | |
| arcgis_wheel_url: | |
| description: "Use a custom version of ArcGIS API for Python from this wheel URL, if empty, use pypi.org; if provided, `-prerelease` will be appended to the image tag" | |
| type: string | |
| default: "" | |
| arcgis_mapping_wheel_url: | |
| description: "Use a custom version of arcgis-mapping from this wheel URL, if empty, install from pypi.org; if provided, `-prerelease` will be appended to the image tag" | |
| type: string | |
| default: "" | |
| is_default_supported_python: | |
| description: "Python version is default supported version (i.e. python used by Pro and Enterprise)" | |
| type: boolean | |
| default: false | |
| jobs: | |
| build-and-push: | |
| name: Build Docker image and push to ghcr.io | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Github Packages | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ghcr.io/esri/arcgis-python-api-notebook | |
| tags: | | |
| type=raw,value=${{ inputs.version }}-python${{ inputs.python_version }}${{ inputs.arcgis_wheel_url != '' && '-prerelease' || '' }} | |
| type=raw,value=${{ inputs.version }},enable=${{ inputs.is_default_supported_python && inputs.arcgis_wheel_url == '' && github.ref_name == github.event.repository.default_branch }} | |
| type=raw,value=latest,enable=${{ inputs.arcgis_wheel_url == '' && inputs.is_latest_release && inputs.is_default_supported_python && github.ref_name == github.event.repository.default_branch }} | |
| type=schedule,pattern={{date 'YY.MM'}},enable=${{ inputs.arcgis_wheel_url == '' && inputs.is_latest_release && inputs.is_default_supported_python && github.ref_name == github.event.repository.default_branch }} | |
| - id: docker_build | |
| name: Build image and push to GitHub Container Registry | |
| uses: docker/build-push-action@v6 | |
| with: | |
| # relative path to the place where source code with Dockerfile is located | |
| context: ./docker | |
| file: ./docker/NotebookImage.Dockerfile | |
| build-args: | | |
| python_version=${{ inputs.python_version }} | |
| arcgis_version=${{ inputs.version }} | |
| arcgis_mapping_version=${{ inputs.arcgis_mapping_version }} | |
| arcgis_wheel_url=${{ inputs.arcgis_wheel_url }} | |
| arcgis_mapping_wheel_url=${{ inputs.arcgis_mapping_wheel_url }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| provenance: false | |
| platforms: linux/amd64 | |
| push: true |