Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pages-deploy.yml.hook #229

Merged
merged 2 commits into from
Dec 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions .github/workflows/pages-deploy.yml.hook
Original file line number Diff line number Diff line change
Expand Up @@ -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