Skip to content

Fix/develop (#549) #212

Fix/develop (#549)

Fix/develop (#549) #212

name: Govern-Console CI/CD
on:
push:
paths:
- 'packages/govern-console/**'
- 'packages/govern/**'
branches:
- 'develop'
- 'master'
env:
working-directory: packages/govern-console
jobs:
build-deploy-develop:
if: github.ref == 'refs/heads/develop'
strategy:
matrix:
environment: ['Rinkeby', 'Rinkeby_Staging']
include:
- environment: 'Rinkeby'
fleekfile: 'console.rinkeby.json'
environment_name: 'rinkeby'
- environment: 'Rinkeby_Staging'
fleekfile: 'console.rinkeby.staging.json'
environment_name: 'staging'
runs-on: ubuntu-latest
environment: ${{ matrix.environment }}
defaults:
run:
working-directory: ${{env.working-directory}}
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 14.15.5
- name: Build the Govern
run: cd ../govern && yarn install --frozen-lockfile && yarn build
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build the app
run: CI='' yarn build
env:
REACT_APP_ANALYTICS_KEY: ${{ secrets.REACT_APP_ANALYTICS_KEY }}
REACT_APP_DEPLOY_VERSION: ${{ github.sha }}
REACT_APP_DEPLOY_ENVIRONMENT: ${{ matrix.environment_name }}
- name: Activate rinkeby's fleek
env:
FLEEK_FILE: ${{ matrix.fleekfile }}
run: mv fleek/$FLEEK_FILE .fleek.json
- name: Deploy fleek
id: deploy
uses: fleekhq/action-deploy@v1
with:
apiKey: ${{ secrets.FLEEK_API_KEY }}
workDir: ${{env.working-directory}}
- name: Get the output url
run: echo "Deploy url is ${{ steps.deploy.outputs.deployUrl }}"
- name: upload sourcemap to apm
env:
COMMIT_SHA: ${{ github.sha }}
run: |
for f in $(find ./build/static/js/ -name *.js.map) ; do
curl -X POST "https://kibana-sourcemaps.aragon.org/api/apm/sourcemaps" \
-H 'Content-Type: multipart/form-data' \
-H 'kbn-xsrf: true' \
-H 'Authorization: ApiKey ${{ secrets.APM_API_KEY }}' \
-F service_name="govern" \
-F service_version="$COMMIT_SHA" \
-F bundle_filepath="http://localhost/static/js/$(basename $f)" \
-F sourcemap=@$f
done
build-and-deploy-mainnet:
runs-on: ubuntu-latest
name: builds and deploys console on mainnet
if: github.ref == 'refs/heads/master'
environment: Mainnet
defaults:
run:
working-directory: ${{env.working-directory}}
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 14.15.5
- name: Build the Govern
run: cd ../govern && yarn install --frozen-lockfile && yarn build
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build the app
run: CI='' yarn build:mainnet
env:
REACT_APP_ANALYTICS_KEY: ${{ secrets.REACT_APP_ANALYTICS_KEY }}
REACT_APP_DEPLOY_VERSION: ${{ github.sha }}
REACT_APP_DEPLOY_ENVIRONMENT: production
- name: Activate mainnet's fleek
run: mv fleek/console.mainnet.json .fleek.json
- name: deploy console
id: deploy
uses: fleekhq/action-deploy@v0.1.4-beta2
with:
apiKey: ${{ secrets.FLEEK_API_KEY }}
workDir: ${{env.working-directory}}
- name: upload sourcemap to apm
env:
COMMIT_SHA: ${{ github.sha }}
run: |
for f in $(find ./build/static/js/ -name *.js.map) ; do
curl -X POST "https://kibana-sourcemaps.aragon.org/api/apm/sourcemaps" \
-H 'Content-Type: multipart/form-data' \
-H 'kbn-xsrf: true' \
-H 'Authorization: ApiKey ${{ secrets.APM_API_KEY }}' \
-F service_name="govern" \
-F service_version="$COMMIT_SHA" \
-F bundle_filepath="http://localhost/static/js/$(basename $f)" \
-F sourcemap=@$f
done