Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
feat(devops): adds prod build excluding tests
Browse files Browse the repository at this point in the history
fix(devops): changes pre-build sequence (#802)

* feat(devops): adds prod build excluding tests

* fix(devops): cp the right tsconfig before build

* fix(devops): adds unnecesary import to fix build

fix(devops): removes production only deps install (#804)

fix(devops): add job environment to each workflow

fix(devops): corrects build directory to sync aws
  • Loading branch information
jurajpiar committed Mar 31, 2021
1 parent 5934ff5 commit 14b261d
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 17 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ name: RIF Marketplace UI deploy

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-**'
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- staging

jobs:
deploy-staging:
name: RIF Marketplace UI - Staging
runs-on: ubuntu-latest
environment: staging

steps:
- name: Checkout
Expand All @@ -33,7 +31,7 @@ jobs:
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm ci --only=production
npm ci
- name: Build site
env:
Expand All @@ -42,9 +40,9 @@ jobs:
REACT_APP_LOG_LEVEL: error
REACT_APP_NETWORK: rskstaging
REACT_APP_REQUIRED_NETWORK_ID: 31
REACT_APP_REQUIRED_NETWORK_NAME: RSK Testnet
REACT_APP_REQUIRED_NETWORK_NAME: RSK Staging
run: |
npm run build
npm run build:prod
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -55,7 +53,7 @@ jobs:

- name: Deploy site to S3
run: |
aws s3 sync --delete --only-show-errors dist/ ${{ secrets.STAGING_S3_BUCKET }}
aws s3 sync --delete --only-show-errors build/ ${{ secrets.STAGING_S3_BUCKET }}
- name: Invalidate CloudFront cache
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# production
/build
/dist

# misc
.DS_Store
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
"url": "https://github.com/rsksmart/rif-marketplace-ui.git"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --unhandled-rejections=strict",
"coverage": "react-scripts test --unhandled-rejections=strict --coverageProvider=v8 --coverage --watchAll=false",
"lint": "eslint --ext=ts --ext=tsx ."
"start": "cp -f ./tsconfig.dev.json ./tsconfig.json && react-scripts start",
"build": "cp -f ./tsconfig.dev.json ./tsconfig.json && react-scripts build",
"build:prod": "cp -f ./tsconfig.prod.json ./tsconfig.json && react-scripts build",
"test": "cp -f ./tsconfig.dev.json ./tsconfig.json && react-scripts test --unhandled-rejections=strict",
"coverage": "cp -f ./tsconfig.dev.json ./tsconfig.json && react-scripts test --unhandled-rejections=strict --coverageProvider=v8 --coverage --watchAll=false",
"lint": "cp -f ./tsconfig.dev.json ./tsconfig.json && eslint --ext=ts --ext=tsx ."
},
"dependencies": {
"@feathersjs/authentication": "^4.5.10",
Expand Down Expand Up @@ -104,4 +105,4 @@
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.ts"
}
}
}
}
5 changes: 4 additions & 1 deletion src/components/organisms/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { FC } from 'react'
import { makeStyles } from '@material-ui/core/styles'
import { NavLinkProps } from 'react-router-dom/NavLink'
import { Footer as RUIFooter } from '@rsksmart/rif-ui'
/* eslint-disable-next-line import/no-unresolved */
import { FooterProps } from '@rsksmart/rif-ui/dist/components/organisms/Footer'
import { FooterProps as RUIFooterProps } from '@rsksmart/rif-ui/dist/components/organisms/Footer'
import { appVersion } from 'config'
import PrivacySettingsModal from './tracking/PrivacySettingsModal'

Expand All @@ -12,6 +13,8 @@ const useStyles = makeStyles(() => ({
},
}))

type FooterProps = RUIFooterProps & NavLinkProps

const Footer: FC = () => {
const classes = useStyles()

Expand Down
5 changes: 3 additions & 2 deletions src/contracts/rns/Marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ class MarketplaceContract extends ContractBase {
buyTx,
{
gasMultiplier: MarketplaceContract.gasMultiplier,
...txOptions
})
...txOptions,
},
)
}
}

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json → tsconfig.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
"include": [
"src"
]
}
}
37 changes: 37 additions & 0 deletions tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"compilerOptions": {
"baseUrl": "src",
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"noImplicitAny": false
},
"include": [
"src"
],
"exclude":[
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.test.ts",
"**/*.test.tsx",
"**/__mocks__/*",
"**/__tests__/*",
"src/globals.d.ts",
"src/api/test-utils/*"
]
}

0 comments on commit 14b261d

Please sign in to comment.