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.
This commit is contained in:
parent
08fbd06c63
commit
ca2194770c
1 changed files with 9 additions and 12 deletions
19
.github/workflows/pages-deploy.yml.hook
vendored
19
.github/workflows/pages-deploy.yml.hook
vendored
|
@ -44,28 +44,25 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
|
baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
|
||||||
if [[ -n $baseurl ]]; then
|
if [[ -n $baseurl ]]; then
|
||||||
echo "SPEC_TEST=_site_no_baseurl" >> $GITHUB_ENV
|
echo "BASE_URL=$baseurl" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build Site
|
- name: Build Site
|
||||||
env:
|
env:
|
||||||
JEKYLL_ENV: production
|
JEKYLL_ENV: production
|
||||||
run: |
|
run: |
|
||||||
bundle exec jekyll b
|
bundle exec jekyll b -d "_site$BASE_URL"
|
||||||
|
|
||||||
if [[ -n $SPEC_TEST ]]; then
|
|
||||||
# Bypass the defects of htmlproofer
|
|
||||||
bundle exec jekyll b -b "" -d "$SPEC_TEST"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Test Site
|
- name: Test Site
|
||||||
run: |
|
run: |
|
||||||
if [[ -n $SPEC_TEST ]]; then
|
|
||||||
bash tools/test.sh -d "$SPEC_TEST"
|
|
||||||
else
|
|
||||||
bash tools/test.sh
|
bash tools/test.sh
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
|
if [[ -n $BASE_URL ]]; then
|
||||||
|
mv _site$BASE_URL _site-rename
|
||||||
|
rm -rf _site
|
||||||
|
mv _site-rename _site
|
||||||
|
fi
|
||||||
|
|
||||||
bash tools/deploy.sh
|
bash tools/deploy.sh
|
||||||
|
|
Loading…
Reference in a new issue