Skip to content

Commit 302dc7f

Browse files
Jade WibbelsJade Wibbels
authored andcommitted
update cicd for aws secrets
1 parent a5569b2 commit 302dc7f

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
docker:
1717
image: docker:19.03.12
1818
options: --privileged
19-
ports:
20-
- 8000:8000
2119

2220
steps:
2321
- name: Checkout code
@@ -26,26 +24,20 @@ jobs:
2624
- name: Set up Python
2725
uses: actions/setup-python@v2
2826
with:
29-
python-version: 3.9
27+
python-version: '3.8'
3028

3129
- name: Install dependencies
3230
run: |
33-
python -m venv venv
34-
source venv/bin/activate
31+
python -m pip install --upgrade pip
3532
pip install -r requirements.txt
36-
pip install black flake8 pytest
3733
38-
- name: Lint with flake8
39-
run: |
40-
source venv/bin/activate
41-
flake8 .
42-
43-
- name: Format with black
44-
run: |
45-
source venv/bin/activate
46-
black --check .
34+
- name: Configure AWS credentials
35+
uses: aws-actions/configure-aws-credentials@v1
36+
with:
37+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
38+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
39+
aws-region: us-east-1
4740

4841
- name: Run tests
4942
run: |
50-
source venv/bin/activate
5143
pytest

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
1-
# python_setup
2-
Python Template
1+
## Python AWS Lambda Setup With local run Option
2+
3+
To run this locally you can either set up a local dynamodb instance, instructions [here](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html).
4+
5+
Or make a couple dynamodb tables to support the back end. I added the scripts I used to create these tables in the `app/awscli.sh` [file](https://github.com/JadeCara/aws_lambda_api_example/blob/a5569b2dd3500fcb24fb299388f1e08a85594296/app/awscli.sh)
6+
7+
### To run locally:
8+
Clone this repo.
9+
10+
>[!TIP]
11+
> Make sure your aws config is set up!
12+
13+
Create your dynamodb tables
14+
15+
Navigate into the project directory
16+
17+
run ```sh uvicorn app.main:app --reload```
18+
19+
>[!TIP]
20+
> Once that is running docs can be found at http://127.0.0.1:8000/docs where they are kindly generated for us by FastApi using openapi.
21+
22+
23+
Curl Commands for all api calls can be found there or in the docstrings on the routes.

0 commit comments

Comments
 (0)