Build and Release Lambda Layer #38
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 and Release Lambda Layer | |
on: | |
release: | |
types: [created] | |
jobs: | |
build-and-release-layer: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install virtualenv | |
- name: Create Lambda Layer | |
run: | | |
virtualenv venv | |
source venv/bin/activate | |
mkdir python | |
echo "coinbase-advancedtrade-python" > requirements.txt | |
docker run --rm -v "$PWD":/var/task public.ecr.aws/sam/build-python3.9:latest /bin/sh -c "pip install --platform manylinux2014_x86_64 --implementation cp --python 3.9 --only-binary=:all: --upgrade -r requirements.txt -t python" | |
zip -r lambda_layer.zip python | |
- name: Upload Layer to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./lambda_layer.zip | |
asset_name: lambda_layer.zip | |
asset_content_type: application/zip |