forked from becloudready/vibe-code-to-prod
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.63 KB
/
deploy.yml
File metadata and controls
59 lines (47 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Deploy Notice Board
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Build Lambda package
working-directory: Projects/task-tracker
run: python build-lambda-pkg.py
- name: Deploy Lambda
run: |
aws lambda update-function-code \
--function-name "${{ secrets.LAMBDA_FUNCTION_NAME }}" \
--zip-file fileb://Projects/task-tracker/backend/lambda.zip
- name: Install frontend deps
working-directory: Projects/task-tracker/frontend
run: npm ci
- name: Build frontend
working-directory: Projects/task-tracker/frontend
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}
run: npm run build
- name: Upload frontend to S3
run: aws s3 sync Projects/task-tracker/frontend/dist/ s3://${{ secrets.S3_BUCKET }}/ --delete
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation \
--distribution-id "${{ secrets.CF_DISTRIBUTION_ID }}" \
--paths "/*"