Skip to content

Bump xarray from 2024.6.0 to 2024.10.0 #279

Bump xarray from 2024.6.0 to 2024.10.0

Bump xarray from 2024.6.0 to 2024.10.0 #279

Workflow file for this run

name: Docker build
# Run if triggered by upstream release, if Dockerfile is updated, or if manually triggered
on:
repository_dispatch:
types: [post-release]
push:
paths:
- 'Dockerfile'
- 'poetry.lock'
workflow_dispatch:
inputs:
version:
description: 'Pyinaturalist version to build'
required: false
default: 'latest'
env:
DOCKERHUB_OWNER: jxcook
IMAGE_NAME: pyinaturalist-notebook
PACKAGE_NAME: pyinaturalist
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Initial setup + login
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Determine pyinaturalist package version to install (either specified version or latest)
- name: Set PyPI package version
id: pypi
run: |
pip install packaging
IS_LATEST=${{ (github.event.inputs.version || 'latest') == 'latest' }}
PYPI_VERSION=$(python ${GITHUB_WORKSPACE}/pypi_version.py ${{ env.PACKAGE_NAME }})
BUILD_VERSION=$(test ${IS_LATEST}=true && echo $PYPI_VERSION || echo ${{ github.event.inputs.version}})
echo "Latest version: ${PYPI_VERSION} | Build version: ${BUILD_VERSION}"
echo "version=${BUILD_VERSION}" >> $GITHUB_OUTPUT
echo "is_latest=${IS_LATEST}" >> $GITHUB_OUTPUT
# Set Docker tags
- name: Set Docker tags
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_OWNER }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
flavor: latest=${{ steps.pypi.outputs.is_latest }}
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha,prefix=,format=short
type=semver,pattern={{version}},value=${{ steps.pypi.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.pypi.outputs.version }}
type=semver,pattern={{major}},value=${{ steps.pypi.outputs.version }}
# Build and publish image
- name: Build and publish image to Docker Hub + GitHub Containers
uses: docker/build-push-action@v6
with:
context: .
pull: true
push: true
build-args: PACKAGE_VERSION=${{ steps.pypi.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}