Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yuli-ferna committed Dec 1, 2023
1 parent 477ee60 commit 27e59a4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ on:
public-url:
type: string
default: /
project-branch:
type: string
default: main
outputs:
pkg-version:
description: "NPM Package Version"
Expand All @@ -36,6 +39,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.project-branch }}
- name: Set up Node environment
uses: actions/setup-node@v3
with:
Expand All @@ -46,8 +51,7 @@ jobs:
npm ci
- name: Build
env:
PUBLIC_URL: "${{ inputs.public-url }}/docs"
# PUBLIC_URL: "/${{ needs.branch-sha.outputs.value }}/docs"
PUBLIC_URL: "${{ inputs.public-url }}docs"
run: |
pushd apps/docs
npm run build
Expand All @@ -69,7 +73,6 @@ jobs:
uses: actions/checkout@v3
with:
repository: xLabs/portal-bridge-ui
# TODO replace with the advance tools branch after cutover
ref: ${{inputs.advanced-tools-branch}}
- name: Set up Node environment
uses: actions/setup-node@v3
Expand All @@ -86,8 +89,7 @@ jobs:
run: npm version $(node -p -e "require('./package.json').version")-${{inputs.separator}}$(echo ${{ github.sha }} | cut -c -10)
- name: Build
env:
PUBLIC_URL: "${{ inputs.public-url }}/advanced-tools"
# PUBLIC_URL: "/${{ needs.branch-sha.outputs.value }}/advanced-tools"
PUBLIC_URL: "${{ inputs.public-url }}advanced-tools"
NODE_OPTIONS: "--max-old-space-size=10240"
GENERATE_SOURCEMAP: false
REACT_APP_BASE_URL: "${{ inputs.public-url }}"
Expand Down Expand Up @@ -119,6 +121,8 @@ jobs:
node-version: v18.17.1
- name: Checkout Portal Bridge
uses: actions/checkout@v3
with:
ref: ${{ inputs.project-branch }}
- name: Build Redirects
env:
PUBLIC_URL: "${{ inputs.public-url }}"
Expand Down Expand Up @@ -162,6 +166,7 @@ jobs:
- name: Checkout Custom Wormhole Connect Loader
uses: actions/checkout@v3
with:
ref: ${{ inputs.project-branch }}
path: connect-loader
- name: Setup Git
run: |
Expand Down Expand Up @@ -221,6 +226,7 @@ jobs:
- name: Checkout Custom Wormhole Connect Loader
uses: actions/checkout@v3
with:
ref: ${{ inputs.project-branch }}
path: connect-loader
- name: Setup Git
run: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Set Version
id: set-version
run: echo "_BRANCH_NAME_SHA=$(echo ${{ github.event.pull_request.head.ref }} | sha256sum | cut -c -10)" >> "${GITHUB_OUTPUT}"
run: echo "_BRANCH_NAME_SHA=$(echo ${{ github.event.workflow_run.head_branch }} | sha256sum | cut -c -10)" >> "${GITHUB_OUTPUT}"
build:
name: "Build Preview"
uses: ./.github/workflows/build.yml
Expand All @@ -27,7 +27,8 @@ jobs:
connect-branch: portal-bridge
advanced-tools-branch: advanced-tools
environment: Cloudflare-Preview
public-url: "${{ needs.branch-sha.outputs.value }}/"
public-url: "/${{ needs.branch-sha.outputs.value }}/"
project-branch: ${{ github.event.workflow_run.head_branch }}
secrets: inherit
needs:
- branch-sha
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
connect-branch: ${{inputs.connect-branch}}
advanced-tools-branch: ${{inputs.advanced-tools-branch}}
environment: ${{inputs.environment}}
project-branch: main
secrets: inherit
deploy:
name: Trigger Production Deploy
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Set Version
id: set-version
run: echo "_BRANCH_NAME_SHA=$(echo ${{ github.event.pull_request.head.ref }} | sha256sum | cut -c -10)" >> "${GITHUB_OUTPUT}"
run: echo "_BRANCH_NAME_SHA=$(echo ${{ github.event.workflow_run.head_branch }} | sha256sum | cut -c -10)" >> "${GITHUB_OUTPUT}"
build:
name: "Build Testnet"
uses: ./.github/workflows/build.yml
Expand All @@ -27,7 +27,8 @@ jobs:
connect-branch: portal-bridge
advanced-tools-branch: advanced-tools
environment: Cloudflare-Testnet
public-url: "${{ needs.branch-sha.outputs.value }}/"
public-url: "/${{ needs.branch-sha.outputs.value }}/"
project-branch: ${{ github.event.workflow_run.head_branch }}
secrets: inherit
needs:
- branch-sha
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const config = {
url: "https://www.portalbridge.com",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: process.env.PUBLIC_URL || "docs",
baseUrl: process.env.PUBLIC_URL || "/docs",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down

0 comments on commit 27e59a4

Please sign in to comment.