Skip to content

Commit

Permalink
CI: update Github actions, move now deployment to action (#1316)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohkai authored Feb 19, 2020
1 parent 7f2bee1 commit 51ad29d
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 10
node-version: 12
- name: npm install
run: npm install
- name: npm lint and build
run: |
npm run lint
npm run build
- name: npm build
run: npm run build
- name: npm test
run: npm run test
env:
CI: true
30 changes: 30 additions & 0 deletions .github/workflows/mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Mainnet deployment

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 12
- name: npm install
run: npm install
- name: npm test
run: npm run test
- name: now
run: >
now
-A now-mainnet.json
--confirm
--prod
--token=${{ secrets.ZEIT_TOKEN }}
--build-env NOW_GITHUB_COMMIT_SHA="$(git log --pretty=format:'%h' -n 1)"
env:
CI: true
5 changes: 4 additions & 1 deletion now-mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"alias": "nightly.aragon.org",
"build": {
"env": {
"ARAGON_ETH_NETWORK_TYPE": "main"
"ARAGON_ETH_NETWORK_TYPE": "main",
"ARAGON_FORTMATIC_API_KEY": "@aragon-client-fortmatic-api-key",
"ARAGON_PORTIS_DAPP_ID": "@aragon-client-portis-dapp-id",
"ARAGON_SENTRY_DSN": "@aragon-client-sentry-dsn"
}
}
}
7 changes: 7 additions & 0 deletions now.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
"alias": "nightly-rinkeby.aragon.org",
"github": {
"silent": true
},
"build": {
"env": {
"ARAGON_FORTMATIC_API_KEY": "@aragon-client-fortmatic-testnet-api-key",
"ARAGON_PORTIS_DAPP_ID": "@aragon-client-portis-dapp-id",
"ARAGON_SENTRY_DSN": "@aragon-client-sentry-dsn"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"build:staging": "cross-env ARAGON_ENS_REGISTRY_ADDRESS=0xfe03625ea880a8cba336f9b5ad6e15b0a3b5a939 npm run build",
"build:ropsten": "cross-env ARAGON_ETH_NETWORK_TYPE=ropsten npm run build",
"lint": "eslint ./src",
"test": "npm run lint && npm run jest",
"test": "npm run lint",
"jest": "jest",
"publish:major": "node scripts/publish major --only-content --files public/",
"publish:minor": "node scripts/publish minor --only-content --files public/",
Expand Down
6 changes: 5 additions & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require('dotenv').config()

const version = require('../package.json').version
const execute = require('child_process').execSync
const commitSha = (process.env.NOW_GITHUB_COMMIT_SHA || '').slice(0, 7)

// First two arguments are node and script name
const buildDir = process.argv[2] || 'public'
Expand All @@ -13,7 +14,10 @@ execute(`copy-aragon-ui-assets -n aragon-ui ./${buildDir}`, {
stdio: 'inherit',
})

process.env.ARAGON_PACKAGE_VERSION = version
// Commit sha is provided in nightly builds
process.env.ARAGON_PACKAGE_VERSION = commitSha
? `${version}-${commitSha}`
: version
execute(
`parcel build src/index.html --out-dir ./${buildDir} --public-url ./ --no-cache`,
{ stdio: 'inherit' }
Expand Down

0 comments on commit 51ad29d

Please sign in to comment.