This repository has been archived by the owner on Aug 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
61 lines (51 loc) · 1.63 KB
/
testnet.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
name: RIF Marketplace UI deploy
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- testnet
jobs:
deploy-staging:
name: RIF Marketplace UI - Testnet
runs-on: ubuntu-latest
environment: testnet
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node 14
uses: actions/setup-node@v1
with:
node-version: '14'
- uses: actions/cache@v2
id: cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: |
npm ci
- name: Build site
env:
REACT_APP_CACHE_ADDR: ${{ secrets.TESTNET_REACT_APP_CACHE_ADDR }}
REACT_APP_UPLOAD_ADDR: ${{ secrets.TESTNET_REACT_APP_UPLOAD_ADDR }}
REACT_APP_LOG_LEVEL: error
REACT_APP_NETWORK: rsktestnet
REACT_APP_REQUIRED_NETWORK_ID: 31
REACT_APP_REQUIRED_NETWORK_NAME: RSK Testnet
run: |
npm run build:prod
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TESTNET_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TESNET_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.TESTNET_AWS_REGION }}
- name: Deploy site to S3
run: |
aws s3 sync --delete --only-show-errors build/ ${{ secrets.TESTNET_S3_BUCKET }}
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.TESTNET_CLOUDFRONT_DISTRIBUTION }} --paths "/*"