-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (51 loc) · 1.41 KB
/
Copy pathdeploy-dev.yml
File metadata and controls
66 lines (51 loc) · 1.41 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
60
61
62
63
64
65
66
name: Deploy to Development
on:
push:
branches:
- dev
permissions:
id-token: write
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
concurrency:
group: development-deployment
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
environment: dev
defaults:
run:
working-directory: .
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies and build
run: npm ci
- name: Build application
run: npm run build
- name: Debug GitHub Context
run: |
echo "Repository: ${{ github.repository }}"
echo "Ref: ${{ github.ref }}"
echo "Environment: dev"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Sync files to S3
run: |
aws s3 sync dist/ s3://${{ secrets.S3_BUCKET }} --delete
- name: Invalidate CloudFront distribution
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} \
--paths "/*"