Merge pull request #40 from silviopaganini/dependabot/npm_and_yarn/ht… #101
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🛎️ Checkout | |
uses: actions/[email protected] | |
- name: ❄️ Cache node modules | |
uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: ⚡️ Install | |
run: yarn install | |
- name: 🔧 Build | |
env: | |
REACT_APP_SERVICE_URL: ${{ secrets.REACT_APP_SERVICE_URL }} | |
REACT_APP_RPC_URL_1: ${{ secrets.REACT_APP_RPC_URL_1 }} | |
REACT_APP_RPC_URL_4: ${{ secrets.REACT_APP_RPC_URL_4 }} | |
NODE_ENV: production | |
run: yarn build | |
- name: 💾 Create artifact | |
run: tar -zcvf build.tar.gz build/ | |
- name: 📦 Archive production artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: nft-marketplace-build | |
path: build.tar.gz | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: success() && github.ref == 'refs/heads/master' | |
steps: | |
- name: 🛎️ Checkout | |
uses: actions/[email protected] | |
- name: 📥 Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: nft-marketplace-build | |
- name: 🔥 Unpack artifact | |
run: tar -zxvf build.tar.gz | |
- name: 🚀 Deploy | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: build |