fix: AWS Config #2
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: CI/CD for Upload to S3 | |
on: | |
push: | |
branches: | |
- upload-to-s3 | |
pull_request: | |
branches: | |
- upload-to-s3 | |
defaults: | |
run: | |
working-directory: ./upload-to-s3 | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23' | |
- name: Install dependencies | |
run: go mod tidy | |
- name: Build for ARM64 on Amazon Linux 2023 | |
env: | |
GOOS: linux | |
GOARCH: arm64 | |
CGO_ENABLED: 0 | |
run: go build -tags lambda.norpc -o bootstrap main.go | |
- name: Deploy to AWS Lambda | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
LAMBDA_FUNCTION_NAME: ${{ secrets.UPLOAD_S3_LAMBDA_FUNCTION_NAME }} | |
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} | |
run: | | |
zip function.zip bootstrap | |
aws lambda update-function-code \ | |
--function-name $LAMBDA_FUNCTION_NAME \ | |
--zip-file fileb://function.zip |