Skip to content

updates for multiarch and refresh #30

updates for multiarch and refresh

updates for multiarch and refresh #30

Workflow file for this run

name: Build
on: [push, pull_request, workflow_dispatch]
jobs:
config:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: echo "::set-output name=matrix::{\"include\":[{\"type\":\"amd64\",\"image\":\"amazon/aws-lambda-provided:al2\", \"arch\":\"x86_64\"},{\"type\":\"arm64\",\"image\":\"amazon/aws-lambda-provided:al2.2022.03.02.08\", \"arch\":\"arm64\"}] }"
containers:
needs: config
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix: ${{fromJson(needs.config.outputs.matrix)}}
env:
PUSH_PACKAGES: ${{ github.repository_owner == 'PDAL' && github.event_name != 'pull_request'}}
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Lint
id: lint
run: |
echo "are we pushing packages" ${{ env.PUSH_PACKAGES }}
echo "event_name" ${{ github.event_name }}
echo "ref" ${{ github.ref }}
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
- if: ${{ env.PUSH_PACKAGES == 'true' }}
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Prepare
id: prep
run: |
VERSION=sha-${GITHUB_SHA::8}
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF/refs\/tags\//}
fi
echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=VERSION::${VERSION}
- name: Build image
uses: docker/build-push-action@v2
with:
push: ${{ env.PUSH_PACKAGES == 'true' }}
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/${{ matrix.type}}
build-args: |
LAMBDA_IMAGE=${{ matrix.image }}
RIE_ARCH=${{ matrix.arch }}
tags: |
ghcr.io/pdal/lambda:${{ steps.prep.outputs.VERSION }}
ghcr.io/pdal/lambda:latest
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }}
org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }}