Skip to content

fix: re-enable landuse evaluate #798

fix: re-enable landuse evaluate

fix: re-enable landuse evaluate #798

Workflow file for this run

name: Build docker image
on:
push:
branches:
- "main"
tags:
- "v*"
pull_request:
env:
REGISTRY_IMAGE: ${{ github.repository }}
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: prod
load: true
- name: Run tests in container
run: |
docker run --rm \
--entrypoint /bin/bash \
${{ steps.meta.outputs.tags }} \
-c "pipenv run pip install .[dev] && pipenv run python -m pytest tests"
build-acr:
name: (ACR) Build Docker Image
runs-on: ${{ matrix.runner }}
environment:
name: azure container registry
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
include:
- platform: linux/amd64
runner: ubuntu-latest
- platform: linux/arm64
runner: ubuntu-22.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
echo "REGISTRY_IMAGE_LOWER=$(echo '${{ env.REGISTRY_IMAGE }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.ACR_ENDPOINT }}/${{ env.REGISTRY_IMAGE_LOWER }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: Log into ACR
uses: docker/login-action@v3
with:
registry: ${{ secrets.ACR_ENDPOINT }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
target: prod
outputs: type=image,push-by-digest=true,name-canonical=true,name=${{ secrets.ACR_ENDPOINT }}/${{ env.REGISTRY_IMAGE_LOWER }},push=true
provenance: false
sbom: false
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests-acr
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests-acr/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-acr-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests-acr/*
if-no-files-found: error
retention-days: 1
deploy-acr:
name: (ACR) Merge and deploy to Azure Container Registry
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')}}
needs: [build-acr, test]
runs-on: ubuntu-latest
environment:
name: azure container registry
permissions:
contents: read
packages: write
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests-acr
pattern: digests-acr-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Prepare
run: |
echo "REGISTRY_IMAGE_LOWER=$(echo '${{ env.REGISTRY_IMAGE }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.ACR_ENDPOINT }}/${{ env.REGISTRY_IMAGE_LOWER }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Log into ACR
uses: docker/login-action@v3
with:
registry: ${{ secrets.ACR_ENDPOINT }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests-acr
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ secrets.ACR_ENDPOINT }}/${{ env.REGISTRY_IMAGE_LOWER }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ secrets.ACR_ENDPOINT }}/${{ env.REGISTRY_IMAGE_LOWER }}:${{ steps.meta.outputs.version }}
build-github:
name: (GHCR) Build Docker Image
runs-on: ${{ matrix.runner }}
environment:
name: github container registry
env:
REGISTRY: ghcr.io
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
include:
- platform: linux/amd64
runner: ubuntu-latest
- platform: linux/arm64
runner: ubuntu-22.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
echo "REGISTRY_IMAGE_LOWER=$(echo '${{ env.REGISTRY_IMAGE }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE_LOWER }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
target: prod
outputs: type=image,push-by-digest=true,name-canonical=true,name=${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE_LOWER }},push=true
provenance: false
sbom: false
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests-ghcr
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests-ghcr/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-ghcr-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests-ghcr/*
if-no-files-found: error
retention-days: 1
deploy-github:
name: (GHCR) Merge and deploy to GitHub container registry
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')}}
needs: [build-github, test]
runs-on: ubuntu-latest
environment:
name: github container registry
env:
REGISTRY: ghcr.io
permissions:
contents: write
packages: write
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests-ghcr
pattern: digests-ghcr-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Prepare
run: |
echo "REGISTRY_IMAGE_LOWER=$(echo '${{ env.REGISTRY_IMAGE }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE_LOWER }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests-ghcr
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE_LOWER }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE_LOWER }}:${{ steps.meta.outputs.version }}