-
Notifications
You must be signed in to change notification settings - Fork 15
52 lines (45 loc) · 1.42 KB
/
deploy-prod.yml
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
name: Deploy to Prod
permissions:
id-token: write
contents: read
on:
workflow_dispatch:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: '14'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
- name: set keys and deploy
env:
DIST_ID: ${{secrets.PROD_DIST_ID}}
PM_TECH_RT: ${{secrets.PM_TECH_RT}}
SITE_URL: ${{secrets.PROD_SITE_URL}}
DOMAIN_NAME: ${{secrets.PROD_DOMAIN_NAME}}
run: |
npm install
npm run clean
npm run build:prod
aws s3 sync ./public/ s3://${{secrets.PROD_BUCKET_NAME}}/main/labs --delete
- name: invalidate
uses: chetan/invalidate-cloudfront-action@v2
env:
PATHS: '/*'
AWS_REGION: '${{ secrets.AWS_REGION }}'
DISTRIBUTION: ${{ secrets.PROD_DIST_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}