Merge pull request #67 from mathewmeconry/fix/decentralized_subgraph #32
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: Deploy fleek | |
on: | |
push: | |
branches: | |
- "develop" | |
- "master" | |
jobs: | |
build-deploy-mainnet: | |
runs-on: ubuntu-latest | |
container: fleek/create-react-app:node-16 | |
if: github.ref == 'refs/heads/master' | |
environment: MAINNET | |
steps: | |
- name: Load secrets from OP | |
uses: 1password/load-secrets-action@v2 | |
with: | |
export-env: true | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PRODUCTION }} | |
THEGRAPH_COURT: op://apikeys_prod/thegraph_courtv2/credential | |
- uses: actions/checkout@v3 | |
- name: Install node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: install dependencies | |
run: yarn install | |
- name: lint | |
run: yarn lint | |
- name: build app | |
env: | |
REACT_APP_ANALYTICS_KEY: ${{ secrets.REACT_APP_ANALYTICS_KEY }} | |
REACT_APP_DEPLOY_VERSION: ${{ github.sha }} | |
REACT_APP_DEPLOY_ENVIRONMENT: production | |
REACT_APP_CHAIN_ID: 1 | |
REACT_APP_ETHERSCAN_ENDPOINT: ${{ secrets.REACT_APP_ETHERSCAN_ENDPOINT }} | |
REACT_APP_SUBGRAPH_API_KEY: "$THEGRAPH_COURT" | |
run: yarn build | |
- name: Activate mainnet's fleek | |
run: mv .github/fleek/mainnet.json .fleek.json | |
- name: Deploy fleek | |
id: deploy | |
uses: fleekhq/[email protected] | |
with: | |
apiKey: ${{ secrets.FLEEK_API_KEY }} | |
- 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/ -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="court" \ | |
-F service_version="$COMMIT_SHA" \ | |
-F bundle_filepath="http://localhost/static/js/$(basename $f)" \ | |
-F sourcemap=@$f | |
done | |
build-deploy-develop: | |
runs-on: ubuntu-latest | |
container: fleek/create-react-app:node-16 | |
if: github.ref == 'refs/heads/develop' | |
strategy: | |
matrix: | |
environment: ["RINKEBY", "STAGING"] | |
include: | |
- environment: "RINKEBY" | |
fleekfile: "rinkeby.json" | |
environment_name: "rinkeby" | |
subgraph_name: "" | |
- environment: "STAGING" | |
fleekfile: "staging.json" | |
environment_name: "staging" | |
subgraph_name: "staging" | |
environment: ${{ matrix.environment }} | |
steps: | |
- name: Load secrets from OP | |
uses: 1password/load-secrets-action@v2 | |
with: | |
export-env: true | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_NONPROD }} | |
THEGRAPH_COURT: op://apikeys_nonprod/thegraph_courtv2/credential | |
- uses: actions/checkout@v3 | |
- name: Install node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: install dependencies | |
run: yarn install | |
- name: lint | |
run: yarn lint | |
- name: build app | |
env: | |
REACT_APP_ANALYTICS_KEY: ${{ secrets.REACT_APP_ANALYTICS_KEY }} | |
REACT_APP_DEPLOY_VERSION: ${{ github.sha }} | |
REACT_APP_DEPLOY_ENVIRONMENT: ${{ matrix.environment_name }} | |
REACT_APP_CHAIN_ID: 4 | |
REACT_APP_ETHERSCAN_ENDPOINT: ${{ secrets.REACT_APP_ETHERSCAN_ENDPOINT }} | |
REACT_APP_SUBGRAPH_NAME: ${{ matrix.subgraph_name }} | |
REACT_APP_SUBGRAPH_API_KEY: "$THEGRAPH_COURT" | |
run: yarn build | |
- name: Activate fleek | |
env: | |
FLEEK_FILE: ${{ matrix.fleekfile }} | |
run: mv .github/fleek/$FLEEK_FILE .fleek.json | |
- name: Deploy fleek | |
id: deploy | |
uses: fleekhq/[email protected] | |
with: | |
apiKey: ${{ secrets.FLEEK_API_KEY }} | |
- 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/ -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="court" \ | |
-F service_version="$COMMIT_SHA" \ | |
-F bundle_filepath="http://localhost/static/js/$(basename $f)" \ | |
-F sourcemap=@$f | |
done |