Created
May 25, 2023 16:16
-
-
Save farhan-helmy/97f90c7650892599d1840d2ae9000c24 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
npm ci
instead ofnpm install
might be better for deployment: https://stackoverflow.com/a/53325242