-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (28 loc) · 1.15 KB
/
Copy pathmarketing.yml
File metadata and controls
35 lines (28 loc) · 1.15 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
name: CI/CD for container
on:
push:
branches:
- main
paths:
- 'packages/marketing/**' #only run this work flow if we make changes inside of this container
defaults:
run:
working-directory: packages/marketing
jobs:
build:
runs-on: ubuntu-latest # running on sopecific virtual machine
steps:
- uses: actions/checkout@v2 # checkout and use our code. similar to "use database" before quering it
- run: npm install
- run: npm run build #build our dist directory
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- run: aws s3 sync dist s3://${{ secrets.AWS_S3_BUCKET_NAME }}/marketing/latest
- run: aws cloudfront create-invalidation --distribution-id ${{secrets.AWS_DISTRIBUTION_ID}} --path "/marketing/latest/remoteEntry.js"
env:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}