diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 2f01367474..d898aa7bd1 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -30,4 +30,4 @@ jobs: with: expected_sha: ${{ github.sha }} target_env: live - pantheon_site_machine_name: documentation-in-nextjs + pantheon_site_machine_name: ${{ vars.PANTHEON_SITE_MACHINE_NAME }} diff --git a/.github/workflows/pr-e2e.yml b/.github/workflows/pr-e2e.yml index 3bc31ed08f..c09d107ec1 100644 --- a/.github/workflows/pr-e2e.yml +++ b/.github/workflows/pr-e2e.yml @@ -22,14 +22,14 @@ jobs: with: expected_sha: ${{ github.event.pull_request.head.sha }} target_env: pr-${{ github.event.pull_request.number }} - pantheon_site_machine_name: documentation-in-nextjs + pantheon_site_machine_name: ${{ vars.PANTHEON_SITE_MACHINE_NAME }} - name: warm containers id: warm_containers shell: bash env: - REFERENCE_BASE_URL: "https://dev-documentation-in-nextjs.pantheonsite.io" - DEPLOYED_BASE_URL: "https://pr-${{ github.event.pull_request.number }}-documentation-in-nextjs.pantheonsite.io" + REFERENCE_BASE_URL: "https://dev-${{ vars.PANTHEON_SITE_MACHINE_NAME }}.pantheonsite.io" + DEPLOYED_BASE_URL: "https://pr-${{ github.event.pull_request.number }}-${{ vars.PANTHEON_SITE_MACHINE_NAME }}.pantheonsite.io" run: | #!/bin/bash set +e @@ -54,7 +54,7 @@ jobs: - name: Check all status codes env: PR_NUMBER: ${{ github.event.pull_request.number }} - SITE_NAME: "documentation-in-nextjs" + SITE_NAME: "${{ vars.PANTHEON_SITE_MACHINE_NAME }}" run: | cd tests/404checking export URL="https://pr-${PR_NUMBER}-${SITE_NAME}.pantheonsite.io" @@ -86,8 +86,8 @@ jobs: id: backstop_tests shell: bash env: - REFERENCE_BASE_URL: "https://dev-documentation-in-nextjs.pantheonsite.io" - DEPLOYED_BASE_URL: "https://pr-${{ github.event.pull_request.number }}-documentation-in-nextjs.pantheonsite.io" + REFERENCE_BASE_URL: "https://dev-${{ vars.PANTHEON_SITE_MACHINE_NAME }}.pantheonsite.io" + DEPLOYED_BASE_URL: "https://pr-${{ github.event.pull_request.number }}-${{ vars.PANTHEON_SITE_MACHINE_NAME }}.pantheonsite.io" run: | #!/bin/bash set +e @@ -125,7 +125,7 @@ jobs: id: playwright_tests shell: bash env: - PLAYWRIGHT_DOMAIN: "pr-${{ github.event.pull_request.number }}-documentation-in-nextjs.pantheonsite.io" + PLAYWRIGHT_DOMAIN: "pr-${{ github.event.pull_request.number }}-${{ vars.PANTHEON_SITE_MACHINE_NAME }}.pantheonsite.io" run: | #!/bin/bash set +e diff --git a/src/middleware.ts b/src/middleware.ts index e0622be0b9..1b9689ddbe 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -226,7 +226,7 @@ export function middleware(request: NextRequest) { // This section handles the HTTP to HTTPS redirects for Pantheon sites. // See https://github.com/pantheon-systems/documentation/issues/9791 // for more context. - const siteMachineName = "documentation-in-nextjs"; + const siteMachineName = process.env.PANTHEON_SITE_MACHINE_NAME || "documentation-in-nextjs"; const incomingProtocol = request.headers.get('x-proto') || ''; const policyDocSurrogateKey = request.headers.get('policy-doc-surrogate-key') || ''; if (incomingProtocol === 'http://' && policyDocSurrogateKey) { diff --git a/tests/playwright/tests/search/search.spec.ts b/tests/playwright/tests/search/search.spec.ts index 9fcdaad11f..5db3df5f50 100644 --- a/tests/playwright/tests/search/search.spec.ts +++ b/tests/playwright/tests/search/search.spec.ts @@ -43,7 +43,7 @@ test('searching from homepage redirects to search page and shows expected result await page.waitForSelector('#results .addsearch-searchresults'); - const expectedPolicyHeadline = ' Overages Policy | Traffic | Pantheon Docs'; + const expectedPolicyHeadline = ' Overages Policy | Pantheon Docs'; const h3s1 = await page.locator('h3').allTextContents(); expect(h3s1.some(text => text.includes(expectedPolicyHeadline))).toBeTruthy(); });