From ca2194770c62ebfe96563900a0d8f73fd8f51bde Mon Sep 17 00:00:00 2001 From: Henk van Achterberg Date: Wed, 30 Dec 2020 15:22:42 +0100 Subject: [PATCH] Update pages-deploy.yml.hook (#229) This change will make the baseurl configuration/testing work. Previous version failed. Posts should have /index.html as suffix in my experience. --- .github/workflows/pages-deploy.yml.hook | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pages-deploy.yml.hook b/.github/workflows/pages-deploy.yml.hook index 4a57ea5..e586527 100644 --- a/.github/workflows/pages-deploy.yml.hook +++ b/.github/workflows/pages-deploy.yml.hook @@ -44,28 +44,25 @@ jobs: run: | baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")" if [[ -n $baseurl ]]; then - echo "SPEC_TEST=_site_no_baseurl" >> $GITHUB_ENV + echo "BASE_URL=$baseurl" >> $GITHUB_ENV fi - name: Build Site env: JEKYLL_ENV: production run: | - bundle exec jekyll b - - if [[ -n $SPEC_TEST ]]; then - # Bypass the defects of htmlproofer - bundle exec jekyll b -b "" -d "$SPEC_TEST" - fi + bundle exec jekyll b -d "_site$BASE_URL" - name: Test Site run: | - if [[ -n $SPEC_TEST ]]; then - bash tools/test.sh -d "$SPEC_TEST" - else - bash tools/test.sh - fi + bash tools/test.sh - name: Deploy run: | + if [[ -n $BASE_URL ]]; then + mv _site$BASE_URL _site-rename + rm -rf _site + mv _site-rename _site + fi + bash tools/deploy.sh