-
Notifications
You must be signed in to change notification settings - Fork 177
37 lines (29 loc) · 1.05 KB
/
ci.yaml
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
name: Deploy S3 Assets
on:
push:
branches: [main]
jobs:
terraform-deploy-assets:
env:
CF_DISTRIBUTION_ID: E1W1OZ8FEAK8E7
runs-on: ubuntu-latest
name: Deploy file to s3 + cloudfront
steps:
- name: Checkout
uses: actions/checkout@master
- 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: us-east-2
- name: Filter empty domain ids
run: cat crossChain.json | jq 'del(.[] | select(.chainId == null))' > crossChain.tmp && mv -f crossChain.tmp crossChain.json
- name: Terraform Plan
run: terraform init
- name: Terraform Plan
run: terraform plan
- name: Terraform Deploy
run: terraform apply -auto-approve
- name: Invalidate Cloudfront Distribution
run: aws cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths '/chaindata.json'