forked from lucadonnoh/artblocks-site-production
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.94 KB
/
deploy-prod.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
name: Netlify production deployment
on:
push:
tags:
- v*
jobs:
deploy-prod:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: node-modules_deploy-prod-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Create production build
env:
REACT_APP_NETWORK: mainnet
REACT_APP_INFURA_KEY: ${{ secrets.REACT_APP_INFURA_KEY_PROD }}
REACT_APP_BLOCK_DELAY_INTERVAL: 3
REACT_APP_GENERATOR_URL_TESTNET: ${{ secrets.REACT_APP_GENERATOR_URL_TESTNET }}
REACT_APP_GENERATOR_STATIC_URL_TESTNET: ${{ secrets.REACT_APP_GENERATOR_STATIC_URL_TESTNET }}
REACT_APP_GENERATOR_URL_MAINNET: ${{secrets.REACT_APP_GENERATOR_URL_MAINNET}}
REACT_APP_GENERATOR_STATIC_URL_MAINNET: ${{ secrets.REACT_APP_GENERATOR_STATIC_URL_MAINNET }}
run: npm run build
- name: Get sha for deploy message
id: sha-short
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Get tag name for deploy message
id: tag-name
run: echo "::set-output name=tag_name::${GITHUB_REF/refs\/tags\//}"
- name: Deploy to Netlify production site
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: "./build"
production-deploy: true
deploy-message: "${{ steps.sha-short.outputs.sha_short }}-${{ steps.tag-name.outputs.tag_name }}"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1