Skip to content

feat: initial version (#11) #13

feat: initial version (#11)

feat: initial version (#11) #13

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: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
- name: Log in to Public ECR
run: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
- 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 \
--tag public.ecr.aws/j5r7n1v7/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 \
--tag public.ecr.aws/j5r7n1v7/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