This repository has been archived by the owner on Feb 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (49 loc) · 1.96 KB
/
ci.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
53
54
55
56
57
58
59
60
61
62
name: Injective Faucet Deployments
on:
push:
branches:
- master
jobs:
mainnet:
env:
## Public
APP_NAME: 'Injective Faucet: Access Unlimited DeFi Markets'
APP_BASE_URL: https://faucet.injective.network
APP_NETWORK: testnetK8s
APP_ENV: testnet
APP_CHAIN_ID: 42
SOURCE_DIR: dist
DEST_DIR: www
## Flags
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
MAINTENANCE_ENABLED: false
METRICS_ENABLED: true
TRANSFER_RESTRICTIONS_ENABLED: false
## Secret
APP_API_FAUCET_ENDPOINT: ${{ secrets.APP_API_FAUCET_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Using Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install Dependencies
run: yarn install
- name: Building the project
run: yarn build
- name: Generating the static pages
run: yarn generate
- name: Use AWS CLI
uses: chrislennon/action-aws-cli@v1.1
- name: Sync to S3 bucket
run: aws s3 sync dist/ s3://$AWS_S3_BUCKET/www --follow-symlinks --delete --exclude 'static/chart/*'
- name: Set Cache Headers
run: aws s3 cp s3://$AWS_S3_BUCKET/www s3://$AWS_S3_BUCKET/www --exclude "*" --include "*.js" --include "*.css" --include "*.svg" --include "*.woff2" --include "*.woff" --include "*.ttf" --recursive --metadata-directive REPLACE --expires 2034-01-01T00:00:00Z --cache-control max-age=2592000,public
- name: Invalidate Cloudfront CDN
run: aws cloudfront create-invalidation --distribution-id=$CLOUDFRONT_DISTRIBUTION_ID --paths "/*"