diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 5f04049..4d0e60e 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -36,10 +36,19 @@ jobs: run: .github/workflows/excluded-paths.sh - name: Test build website - # We also create the CNAME file, this is useless in staging, + # When running this test in a PR from the staging to the production repository, + # vars.* variables are not made avaiable to the action !?! + # c.f: see https://github.com/orgs/community/discussions/44322 + # We are thus faking those by sourcing .env.sample file + # thus using hopefully harmless staging values + # + # We also create the CNAME file, which is useless in staging, # but required in production. - # It is created temporarily in the static/ folder, because - # docusaurus will copy it to /build + # It is created temporarily in the static/ folder, and docusaurus will + # copy it to the /build directory run: | + if [ -z "$DTT_DOCS_URL" ] || [ -z "DTT_DOCS_BASE_PATH" ]; then + source .env.sample + fi echo "$DTT_DOCS_URL" | cut -f 3 -d/ | tee static/CNAME npm run build \ No newline at end of file