Skip to content

Commit

Permalink
Merge branch 'main' into remove_gdal2
Browse files Browse the repository at this point in the history
  • Loading branch information
DirkEilander authored Oct 18, 2023
2 parents 9c78420 + fb7609b commit caee6a7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 28 deletions.
60 changes: 33 additions & 27 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ on:
required: true
type: boolean
default: false
version:
description: 'The version to publish'
required: true
type: text


jobs:
publish-docker-image:
strategy:
fail-fast: false
matrix:
flavour: ['min','slim','full']
name: ${{ matrix.flavour }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -28,46 +37,43 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Setup variables
run: |
if [ "${{ github.event_name }}" == "release" ]; then
echo "should_publish=true" >> $GITHUB_ENV
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "should_publish=${{ github.event.inputs.publish }}" >> $GITHUB_ENV
fi
shell: bash

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.TEST_DOCKERHUB_USERNAME }}
password: ${{ secrets.TEST_DOCKERHUB_TOKEN }}

- name: Build and test
uses: docker/build-push-action@v4
with:
context: .
load: true
target: full

- name: Run Tests
run: docker run --rm hydromt pytest

#build should be cached from previous steps
- name: Build and push full image
uses: docker/build-push-action@v4
with:
context: .
load: true
target: full
push: ${{ inputs.publish }}
tags: deltares/hydromt:full
- name: generate envs
run: |
pip install tomli
python make_env.py -p '3.11' -o ${{ matrix.flavour }}-environment.yml ${{ matrix.flavour }}
- name: Build and push min image
- name: Build and push ${{ matrix.flavour }} image
uses: docker/build-push-action@v4
with:
context: .
load: true
target: min
push: ${{ inputs.publish }}
tags: deltares/hydromt:min
target: ${{ matrix.flavour }} #
push: ${{ env.should_publish }}
tags: deltares/hydromt:${{ env.version }}-${{ matrix.flavour }}

- name: Build and push slim image
- name: Build and push latest image
if: matrix.flavour == 'slim'
uses: docker/build-push-action@v4
with:
context: .
load: true
target: slim
push: ${{ inputs.publish }}
tags: deltares/hydromt:slim
target: ${{ matrix.flavour }} #
push: ${{ env.should_publish }}
tags: deltares/hydromt:${{ env.version }}, deltares/hydromt:latest
2 changes: 1 addition & 1 deletion .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: generate envs
run: |
pip install tomli
python make_env.py -p 3.11 -o full-environment.yml full
python make_env.py -p "3.11" -o full-environment.yml full
- name: Build and test
uses: docker/build-push-action@v4
Expand Down

0 comments on commit caee6a7

Please sign in to comment.