Skip to content

Commit

Permalink
add portal bridge build
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Oct 17, 2023
1 parent 02e9a9f commit 7dfda88
Showing 1 changed file with 60 additions and 7 deletions.
67 changes: 60 additions & 7 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,56 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: docs-preview-build
name: preview-docs-build
path: apps/docs/build

portal:
name: "Build Portal Bridge (Advance)"
runs-on: xlabs-large-runner
concurrency:
group: ${{ github.ref }}-portal-preview
cancel-in-progress: true
environment: Cloudflare-Preview
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node environment
uses: actions/setup-node@v3
with:
node-version: v18.17.1
- name: Setup Git
run: |
git config user.name "xLabs CI"
git config user.email "devops@xlabs.xyz"
- name: Install dependencies
run: npm install
- name: Set Version
id: set-version
run: |
npm version $(node -p -e "require('./package.json').version")-P$(echo ${{ github.sha }} | cut -c -10)
echo "_PKG_VERSION=$(node -p -e "require('./package.json').version")" >> "${GITHUB_OUTPUT}"
echo "_BRANCH_NAME_SHA=$(echo ${{ github.event.pull_request.head.ref }} | sha256sum | cut -c -10)" >> "${GITHUB_OUTPUT}"
- name: Build
env:
PUBLIC_URL: "/${{ steps.set-version.outputs._BRANCH_NAME_SHA }}"
NODE_OPTIONS: "--max-old-space-size=10240"
REACT_APP_CLUSTER: ${{ vars.REACT_APP_CLUSTER }}
REACT_APP_SOLANA_API_URL: ${{ vars.REACT_APP_SOLANA_API_URL }}
REACT_APP_COVALENT_API_KEY: ${{ secrets.REACT_APP_COVALENT_API_KEY }}
REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}
run: |
pushd public
npm run set-version
popd
echo 'REACT_APP_VERSION=$npm_package_version' > .env
npm run build
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: preview-advance-build
path: build

connect:
name: "Build Portal Bridge"
runs-on: "ubuntu-latest"
concurrency:
Expand Down Expand Up @@ -73,7 +120,7 @@ jobs:
- name: Build Portal Bridge
env:
PUBLIC_URL: "/${{ steps.set-version.outputs._BRANCH_NAME_SHA }}"
VITE_APP_VERSION: ${{ github.event.pull_request.head.ref }}
VITE_APP_VERSION: ${{ steps.set-version.outputs._BRANCH_NAME_SHA }}
VITE_APP_CLUSTER: "mainnet"
run: |
npm install -g husky
Expand All @@ -93,7 +140,7 @@ jobs:
- name: Upload Portal Bridge Artifact
uses: actions/upload-artifact@v3
with:
name: preview-build
name: preview-connect-build
path: portal/apps/connect/dist
- name: Deploy metadata
run: |
Expand All @@ -104,13 +151,14 @@ jobs:
- name: Upload Deploy metadata
uses: actions/upload-artifact@v3
with:
name: preview-deploy-metadata
name: deploy-metadata
path: deploy-metadata

publish:
name: "Publish"
needs:
- portal
- connect
- docs
runs-on: "ubuntu-latest"
concurrency:
Expand All @@ -123,11 +171,16 @@ jobs:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: preview-build
name: preview-connect-build
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: preview-advance-build
path: advance
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: docs-preview-build
name: preview-docs-build
path: docs
- name: Set up GitHub NPM registry
uses: actions/setup-node@v3
Expand Down Expand Up @@ -161,7 +214,7 @@ jobs:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: preview-deploy-metadata
name: deploy-metadata
path: deploy-metadata
- name: Set deploy metadata
id: set-version
Expand Down

0 comments on commit 7dfda88

Please sign in to comment.