diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9925b925a..92b1fd34c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,9 @@ on: public-url: type: string default: / + project-branch: + type: string + default: main outputs: pkg-version: description: "NPM Package Version" @@ -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: @@ -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 @@ -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 @@ -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 }}" @@ -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 }}" @@ -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: | @@ -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: | diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 13d00f02f..fe815e6f8 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -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 @@ -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 diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 1ecd6696a..cde86e67b 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -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 diff --git a/.github/workflows/testnet.yml b/.github/workflows/testnet.yml index 22547f9f8..dd3f2df10 100644 --- a/.github/workflows/testnet.yml +++ b/.github/workflows/testnet.yml @@ -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 @@ -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 diff --git a/apps/docs/docusaurus.config.js b/apps/docs/docusaurus.config.js index 1e1290991..606f63083 100644 --- a/apps/docs/docusaurus.config.js +++ b/apps/docs/docusaurus.config.js @@ -14,7 +14,7 @@ const config = { url: "https://www.portalbridge.com", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - 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.