VAR CI/CD Pipeline #4
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: VAR CI/CD Pipeline | |
on: | |
workflow_dispatch: | |
jobs: | |
build-and-push-lambda: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Build upload listener Lambda | |
run: | | |
cd upload-listener | |
rm -rf ./package | |
mkdir -p ./package | |
cp listener_lambda.py ./package/ | |
pip install --upgrade pip | |
pip install -r requirements.txt -t ./package | |
- name: Zip | |
run: | | |
cd upload-listener | |
cd ./package && zip -r9 ../upload_listener.zip . && cd .. | |
rm -rf ./package | |
- name: Echo Config | |
run: | | |
echo ${{ vars.AWS_REGION }} | |
echo ${{ vars.ENVIRONMENT_STAGE }} | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: ${{ vars.AWS_REGION }} | |
role-to-assume: ${{ vars.PIPELINE_EXEC_ROLE_ARN }} | |
role-session-name: GitHubActions | |
role-duration-seconds: 3600 | |
- name: Upload to S3 | |
run: aws s3 cp upload-listener/upload_listener.zip s3://${{ vars.S3_LAMBDA_BUCKET }}/upload_listener/latest/function.zip |