Build #39
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '40 7 * * 2' | |
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.2023.12.14.13\", \"arch\":\"arm64\"}] }" | |
containers: | |
needs: config | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
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@v3 | |
- 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@v3 | |
with: | |
version: latest | |
- if: ${{ env.PUSH_PACKAGES == 'true' }} | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_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@v5 | |
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 }} | |