Skip to content

Instantly share code, notes, and snippets.

@farhan-helmy
Created May 25, 2023 16:16
Show Gist options
  • Save farhan-helmy/97f90c7650892599d1840d2ae9000c24 to your computer and use it in GitHub Desktop.
Save farhan-helmy/97f90c7650892599d1840d2ae9000c24 to your computer and use it in GitHub Desktop.
image: python:3.9-alpine
before_script:
- apk update
- cd ~
- mkdir .aws && touch .aws/credentials
- printf "[cikguuapi]\naws_access_key_id = $AWS_ACCESS_KEY_ID\naws_secret_access_key = $AWS_SECRET_ACCESS_KEY" >> .aws/credentials
stages: # List of stages for jobs, and their order of execution
- build
build-job: # This job runs in the build stage, which runs first.
stage: build
script:
- echo "Compiling the code..."
- apk add --no-cache --update postgresql-dev gcc python3-dev musl-dev libpq nodejs npm
- pip install --upgrade pip setuptools
- npm install -g serverless
- cd /builds/farhan-helmy/django-lambda-deploy
- pip install -r requirements.txt
- npm i
- npm run deploy
- echo "Compile complete."
@pokgak
Copy link

pokgak commented May 25, 2023

Using npm ci instead of npm install might be better for deployment: https://stackoverflow.com/a/53325242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment