Merge pull request #10 from piercefreeman/feature/maturin-builder #11
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: Publish lambda-chromium | |
on: | |
push: | |
branches: | |
- main | |
env: | |
BUILD_PATH: lambda-chromium | |
IMAGE: piercefreeman/lambda-chromium | |
ARCHITECTURES: linux/amd64 | |
CACHE_KEY: buildx-cache-${{ github.sha }} | |
jobs: | |
push_readme: | |
name: Push DockerHub README | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- uses: piercefreeman/actions/dockerhub-description@main | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
repository: ${{ env.IMAGE }} | |
short-description: "Run chromium on AWS Lambda" | |
readme-filepath: ${{ env.BUILD_PATH }}/README.md | |
push_to_registry: | |
strategy: | |
matrix: | |
playwright_version: ["1.31.1", "1.37.1"] | |
name: Push to DockerHub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ env.CACHE_KEY }} | |
restore-keys: | | |
buildx-cache- | |
- name: Log in to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
# Unlike on OSX with Docker Desktop, a builder is not setup by default. We need this | |
# for downstream buildx tasks. | |
# We first need to setup binfmt to support arm64 builds | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: ${{ env.BUILD_PATH }} | |
platforms: ${{ env.ARCHITECTURES }} | |
build-args: | | |
PLAYWRIGHT_VERSION=${{ matrix.playwright_version }} | |
push: true | |
tags: ${{ env.IMAGE }}:${{ matrix.playwright_version }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache |