Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/nb-rpc-uri-dashboard-build' into…
Browse files Browse the repository at this point in the history
… feat/network-toggle
  • Loading branch information
elclandestin0 committed Dec 6, 2024
2 parents 2f6be7f + f9b5773 commit 3ada1d2
Show file tree
Hide file tree
Showing 48 changed files with 19,264 additions and 257 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build_prod_wb-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build prod WB dashboard

on:
pull_request:
branches:
- "main"
- "staging"
paths:
- ".github/workflows/build_prod_wb-dashboard.yml"
- "webapps/world-builder-dashboard/**"

jobs:
build_prod_wb-dashboard:
runs-on: ubuntu-latest

steps:
- name: Checkout repository and main branch
uses: actions/checkout@v2

- name: Set up node.js
uses: actions/setup-node@v3
with:
node-version: "20.14.0"

- name: Build frontend
working-directory: ./webapps/world-builder-dashboard
env:
VITE_NB_JSON_RPC_URI: ${{ secrets.VITE_NB_JSON_RPC_URI }}
VITE_NB_WB_DASHBOARD_ACCESS_ID: ${{ secrets.VITE_NB_WB_DASHBOARD_ACCESS_ID }}
run: |
npm install
npm run build
14 changes: 10 additions & 4 deletions .github/workflows/build.yml → .github/workflows/build_web3.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
name: Build
name: Build Smart Contracts

on:
pull_request:
branches:
- main
paths:
- '.github/workflows/build_web3.yml'
- 'web3/**'

jobs:
build:
build_web3:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive # Ensure submodules are checked out and
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -31,4 +37,4 @@ jobs:
run: go install github.com/G7DAO/seer@latest
- name: Build everything
run: |
make
make
53 changes: 53 additions & 0 deletions .github/workflows/deploy_manual_branch_wb-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Manual Deploy branch WB dashboard

on:
workflow_dispatch: # Allow manual trigger
inputs:
branch:
description: "Branch to deploy"
required: true
default: "staging"

jobs:
deploy_manual_branch_wb-dashboard:
runs-on: ubuntu-latest

steps:
- name: Show branch name
run: |
echo "Running manual deployment for ${{ github.event.inputs.branch || github.event.pull_request.head.ref }} branch"
- name: Checkout repository and main branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch || github.event.pull_request.head.ref }}

- name: Set up node.js
uses: actions/setup-node@v3
with:
node-version: "20.14.0"

- name: Install and build staging app
working-directory: ./webapps/world-builder-dashboard
env:
VITE_NB_JSON_RPC_URI: ${{ secrets.VITE_NB_JSON_RPC_URI }}
VITE_NB_WB_DASHBOARD_ACCESS_ID: ${{ secrets.VITE_NB_WB_DASHBOARD_ACCESS_ID }}
VITE_BUILD_TARGET: ${{ github.event.inputs.branch || github.event.pull_request.head.ref }}
run: |
npm install
npm run build
- name: Update robots.txt, block alpha for crawlers
working-directory: ./webapps/world-builder-dashboard/dist
run: |
sed -i "s/Disallow:.*/Disallow: \//" robots.txt
- name: Upload static site to S3 bucket and invalidate CloudFront cache
working-directory: ./webapps/world-builder-dashboard
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
run: |
aws s3 sync ./dist ${{ secrets.AWS_FRONTEND_BUCKET_WB_DASHBOARD_BRANCH }}/${{ github.event.inputs.branch || github.event.pull_request.head.ref }} --delete
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID_WB_DASHBOARD_BRANCH }} --paths '/${{ github.event.inputs.branch || github.event.pull_request.head.ref }}/*'
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
branches:
- main
paths:
- '.github/workflows/prod_deploy_protocol-api.yml'
- '.github/workflows/deploy_prod_protocol-api.yml'
- "api/**"

jobs:
prod_deploy_protocol-api:
deploy_prod_protocol-api:
runs-on: ubuntu-latest

steps:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/deploy_prod_wb-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy prod WB dashboard

on:
push:
branches:
- main
paths:
- ".github/workflows/deploy_prod_wb-dashboard.yml"
- "webapps/world-builder-dashboard/**"

jobs:
deploy_prod_wb-dashboard:
runs-on: ubuntu-latest

steps:
- name: Checkout repository and main branch
uses: actions/checkout@v2
with:
ref: main

- name: Set up node.js
uses: actions/setup-node@v3
with:
node-version: "20.14.0"

- name: Install and build production app
working-directory: ./webapps/world-builder-dashboard
env:
VITE_NB_JSON_RPC_URI: ${{ secrets.VITE_NB_JSON_RPC_URI }}
VITE_NB_WB_DASHBOARD_ACCESS_ID: ${{ secrets.VITE_NB_WB_DASHBOARD_ACCESS_ID }}
run: |
npm install
npm run build
- name: Publish to CloudFlare Page
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN_PROD }}
accountId: ${{ secrets.CF_ACCOUNT_ID_PROD }}
projectName: ${{ secrets.CF_PROJECT_NAME_WB_DASHBOARD_PROD }}
directory: ./webapps/world-builder-dashboard/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/deploy_staging_wb-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy staging WB dashboard

on:
push:
branches:
- staging
paths:
- ".github/workflows/deploy_staging_wb-dashboard.yml"
- "webapps/world-builder-dashboard/**"

jobs:
deploy_staging_wb-dashboard:
runs-on: ubuntu-latest

steps:
- name: Checkout repository and main branch
uses: actions/checkout@v2
with:
ref: staging

- name: Set up node.js
uses: actions/setup-node@v3
with:
node-version: "20.14.0"

- name: Install and build staging app
working-directory: ./webapps/world-builder-dashboard
env:
VITE_NB_JSON_RPC_URI: ${{ secrets.VITE_NB_JSON_RPC_URI }}
VITE_NB_WB_DASHBOARD_ACCESS_ID: ${{ secrets.VITE_NB_WB_DASHBOARD_ACCESS_ID }}
VITE_BUILD_TARGET: staging
run: |
npm install
npm run build
- name: Update robots.txt, block alpha for crawlers
working-directory: ./webapps/world-builder-dashboard/dist
run: |
sed -i "s/Disallow:.*/Disallow: \//" robots.txt
- name: Publish to CloudFlare Page
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN_STAGE }}
accountId: ${{ secrets.CF_ACCOUNT_ID_STAGE }}
projectName: ${{ secrets.CF_PROJECT_NAME_WB_DASHBOARD_STAGE }}
directory: ./webapps/world-builder-dashboard/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
26 changes: 0 additions & 26 deletions .github/workflows/prod_build_wb-dashboard.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/prod_deploy_wb-dashboard.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/release-game7.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Prepare release
name: Prepare release game7 app

on:
push:
tags:
- "game7-v*"

jobs:
create_release:
release-game7:
runs-on: ubuntu-20.04
steps:
- uses: actions/create-release@v1
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/staging_deploy_wb-dashboard.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/test_web3.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Smart Contracts Test
name: Test Smart Contracts

on:
pull_request:
Expand All @@ -14,6 +14,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive # Ensure submodules are checked out and

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "web3/lib/forge-std"]
path = web3/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "web3/contracts/utils/diamonds"]
path = web3/contracts/utils/diamonds
url = https://github.com/mudgen/diamond-3-hardhat
Loading

0 comments on commit 3ada1d2

Please sign in to comment.