Skip to content

feat: add concurrency control to workflows #2

feat: add concurrency control to workflows

feat: add concurrency control to workflows #2

name: Build Installers
on:
push:
branches: [ main, develop ]
paths:
- 'Dockerfile'
- '.github/workflows/build-installers.yml'
pull_request:
branches: [ main ]
paths:
- 'Dockerfile'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-installers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push installers
run: |
# Build awscurl-installer
docker buildx build \
--platform linux/arm64 \
--provenance=false \
--target awscurl-installer \
--tag ghcr.io/${{ github.repository_owner }}/lambda-shell-runtime:awscurl-installer \
--push \
-f - . << 'EOF'
FROM public.ecr.aws/lambda/provided:al2023 AS awscurl-installer
RUN dnf install -y unzip python3-pip findutils && dnf clean all
RUN pip3 install --no-cache-dir --target /tmp/awscurl awscurl && \
find /tmp/awscurl -type d -name '__pycache__' -exec rm -rf {} + && \
find /tmp/awscurl -type f -name '*.pyc' -delete && \
find /tmp/awscurl -type d -name '*.dist-info' -exec rm -rf {} +
EOF
# Build awscli-installer
docker buildx build \
--platform linux/arm64 \
--provenance=false \
--target awscli-installer \
--tag ghcr.io/${{ github.repository_owner }}/lambda-shell-runtime:awscli-installer \
--push \
-f - . << 'EOF'
FROM public.ecr.aws/lambda/provided:al2023 AS awscli-installer
RUN dnf install -y aws-cli && dnf clean all
EOF