Skip to content

Commit

Permalink
replace matrix with env
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Varner committed Nov 28, 2023
1 parent 84f93e1 commit 8c4e282
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ on:
- '*'
pull_request:

env:
GDAL_VERSION: 3.8.0
GDAL_VERSION_TAG: 3.8

jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
gdal-version: ["3.8.0"]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -52,8 +53,8 @@ jobs:
load: true
file: dockerfiles/Dockerfile
build-args: |
GDAL_VERSION=${{ matrix.gdal-version }}
tags: ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ matrix.gdal-version }}
GDAL_VERSION=${{ env.GDAL_VERSION }}
tags: ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand All @@ -63,7 +64,7 @@ jobs:
--platform=linux/amd64 \
--entrypoint bash \
-v ${{ github.workspace }}:/local \
--rm ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ matrix.gdal-version }} \
--rm ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }} \
/local/tests/tests.sh
deploy:
Expand Down Expand Up @@ -97,32 +98,32 @@ jobs:
context: .
file: dockerfiles/Dockerfile
build-args: |
GDAL_VERSION=${{ matrix.gdal-version }}
GDAL_VERSION=${{ env.GDAL_VERSION }}
push: true
cache-from: type=gha
tags: ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ matrix.gdal-version }}
tags: ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }}

- name: Build and Deploy layers
run: |
docker run \
--platform=linux/amd64 \
--entrypoint bash \
-v ${{ github.workspace }}:/local \
--rm ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ matrix.gdal-version }} \
--rm ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }} \
/local/scripts/create-layer.sh
python scripts/deploy.py ${{ matrix.gdal-version }} --deploy
python scripts/deploy.py ${{ env.GDAL_VERSION }} --deploy
- name: Build Runtime and Push
run: |
runtimes='3.9 3.10 3.11'
for runtime in ${runtimes}; do
docker build \
--platform=linux/amd64 \
--build-arg GDAL_VERSION=${{ matrix.gdal-version }} \
--build-arg GDAL_VERSION=${{ env.GDAL_VERSION }} \
--build-arg RUNTIME_VERSION=${runtime} \
-f dockerfiles/runtimes/python \
-t ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ matrix.gdal-version }}-python${runtime} .
docker push ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ matrix.gdal-version }}-python${runtime}
-t ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }}-python${runtime} .
docker push ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }}-python${runtime}
done
update-layer:
Expand Down

0 comments on commit 8c4e282

Please sign in to comment.