Skip to content

Commit ed25301

Browse files
committed
fix(ci): build and deploy
1 parent 8855d77 commit ed25301

File tree

2 files changed

+9
-31
lines changed

2 files changed

+9
-31
lines changed

.github/workflows/deploy_lambda.yml

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
- uses: actions/checkout@v4
2727

2828
- uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.12"
2931
- run: |
3032
pip install poetry
3133
poetry install --no-interaction
@@ -38,46 +40,20 @@ jobs:
3840
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
3941
aws-region: ${{ env.AWS_REGION }}
4042

41-
- name: Login to Amazon ECR
42-
uses: aws-actions/amazon-ecr-login@v2
43-
44-
- name: Generate image tag
45-
id: image-tag
46-
run: |
47-
IMAGE_TAG=$(git rev-parse --short HEAD)
48-
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
49-
50-
- name: Get ECR URI
51-
id: ecr-uri
52-
run: |
53-
REPO_URI=$(aws cloudformation describe-stacks \
54-
--stack-name ${{ env.STACK_NAME }} \
55-
--query 'Stacks[0].Outputs[?OutputKey==`RepositoryUri`].OutputValue' \
56-
--output text)
57-
if [ -z "$REPO_URI" ]; then
58-
echo "Failed to get ECR repository URI"
59-
exit 1
60-
fi
61-
echo "REPO_URI=${REPO_URI}" >> $GITHUB_ENV
62-
63-
- name: Build and push image
64-
run: |
65-
docker build -f deploy/aws_sam/Dockerfile -t ${{ env.REPO_URI }}:${{ env.IMAGE_TAG }} .
66-
docker push ${{ env.REPO_URI }}:${{ env.IMAGE_TAG }}
67-
6843
- uses: aws-actions/setup-sam@v2
6944

70-
- name: Deploy with SAM
45+
- name: SAM Build
46+
run: ./scripts/build-sam.sh
47+
48+
- name: SAM Deploy
7149
run: |
7250
cd deploy/aws_sam
7351
sam deploy \
74-
--stack-name ${{ env.STACK_NAME }} \
7552
--no-confirm-changeset \
7653
--no-fail-on-empty-changeset \
7754
--parameter-overrides \
78-
ImageTag="${{ env.IMAGE_TAG }}" \
7955
LoggingLevel="${{ env.LOGGING_LEVEL }}" \
8056
Workers="${{ env.WORKERS }}" \
8157
PostgresUri="${{ secrets.POSTGRES_URI }}" \
8258
Neo4jUri="${{ secrets.NEO4J_URI }}" \
83-
Neo4jPassword="${{ secrets.NEO4J_PASSWORD }}" \
59+
Neo4jPassword="${{ secrets.NEO4J_PASSWORD }}"

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
2123
- run: |
2224
pip install poetry
2325
poetry install --no-interaction

0 commit comments

Comments
 (0)