Skip to content

Switch to GHA and GHCR for image building and hosting #77

Switch to GHA and GHCR for image building and hosting

Switch to GHA and GHCR for image building and hosting #77

Workflow file for this run

name: Build and Push Georust Docker Images

Check failure on line 1 in .github/workflows/imagebuild.yml

View workflow run for this annotation

GitHub Actions / Build and Push Georust Docker Images

Invalid workflow file

The workflow is not valid. .github/workflows/imagebuild.yml: (Line: 81, Col: 36, Idx: 2324) - (Line: 81, Col: 51, Idx: 2339): While scanning a plain scalar, find unexpected ':'.
on:
push:
branches:
- main
- staging
- trying
pull_request:
merge_group:
env:
LIBPROJ_VERSION: 9.4.0
MAIN_IMAGE_NAME: libproj-builder
jobs:
build_main_image:
name: Build the main image for geo and proj
runs-on: ubuntu-latest
strategy:
matrix:
rust_version: [1.77]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Up Builder
run: |
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
- name: Build and export main image to Docker
uses: docker/build-push-action@v5
with:
file: ./dockerfiles/${{ env.MAIN_IMAGE_NAME }}
push: false
load: true
platforms: linux/amd64
tags: ghcr.io/${{ github.repository_owner }}/${{ env.MAIN_IMAGE_NAME }}:proj-${{ env.LIBPROJ_VERSION }}-rust-${{ matrix.rust_version }}
build-args: |
RUST_VERSION=${{ matrix.rust_version }}
PROJ_VERSION=${{ env.LIBPROJ_VERSION }}
- name: Push tested main image
uses: docker/build-push-action@v5
with:
file: ./dockerfiles/${{ env.MAIN_IMAGE_NAME }}
push: true
load: false
# platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ github.repository_owner }}/${{ env.MAIN_IMAGE_NAME }}:proj-${{ env.LIBPROJ_VERSION }}-rust-${{ matrix.rust_version }}
outputs: type=docker,dest=/tmp/${{ env.MAIN_IMAGE_NAME }}-proj-${{ env.LIBPROJ_VERSION }}-rust-${{ matrix.rust_version }}.tar
build-args: |
RUST_VERSION=${{ matrix.rust_version }}
PROJ_VERSION=${{ env.LIBPROJ_VERSION }}
build_dependent_images:
name: Build dependent images for geo and proj
needs: build_main_image
runs-on: ubuntu-latest
strategy:
matrix:
subimages: [
{image: geo-ci, testcmd: git clone https://github.com/georust/geo && cd geo && cargo test --no-default-features && cargo test && cargo test --all-features},
{image: proj-ci, testcmd: git clone https://github.com/georust/proj && cd proj && cargo test --no-default-features && cargo test --features bundled_proj && cargo test --features network},
{image: proj-ci-without-system-proj, testcmd: git clone https://github.com/georust/proj && cd proj && _PROJ_SYS_TEST_EXPECT_BUILD_FROM_SRC=1 cargo test}
]
rust_version: [1.77]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Up Builder
run: |
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
- name: Build ${{ matrix.subimages.image }}
uses: docker/build-push-action@v5
with:
file: ./dockerfiles/${{ matrix.subimages.image }}
push: false
load: true
platforms: linux/amd64
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.subimages.image }}:proj-${{ env.LIBPROJ_VERSION }}-rust-${{ matrix.rust_version }}
build-args: |
RUST_VERSION=${{ matrix.rust_version }}
PROJ_VERSION=${{ env.LIBPROJ_VERSION }}
- name: Test ${{ matrix.subimages.image }}
run: |
docker run --rm ghcr.io/${{ github.repository_owner }}/${{ matrix.subimages.image }}:proj-${{ env.LIBPROJ_VERSION }}-rust-${{ matrix.rust_version }} /bin/bash -c "${{ matrix.subimages.testcmd }}"
- name: Push tested ${{ matrix.subimages.image }} image
uses: docker/build-push-action@v5
with:
file: ./dockerfiles/${{ matrix.subimages.image }}
push: true
load: false
# platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.subimages.image }}:proj-${{ env.LIBPROJ_VERSION }}-rust-${{ matrix.rust_version }}
outputs: type=docker,dest=/tmp/${{ matrix.subimages.image }}-proj-${{ env.LIBPROJ_VERSION }}-rust-${{ matrix.rust_version }}.tar
build-args: |
RUST_VERSION=${{ matrix.rust_version }}
PROJ_VERSION=${{ env.LIBPROJ_VERSION }}