-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (30 loc) · 994 Bytes
/
front-deploy.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
name: Deploy to CloudFront
on:
push:
branches: [ "dev" ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set .env file
run: |
touch .env
echo "${{ secrets.VUE_SECRETS }}" > .env
- name: Build project
run: |
yarn install
yarn build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Upload to S3 test
run: |
aws s3 sync ./dist/ s3://${{ secrets.S3_BUCKET_NAME }} --region ${{ secrets.AWS_REGION }}
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*"