Deploy preview site to review pull requests #5

Merged
btlogy merged 32 commits from 1.site-preview into main 2024-05-24 11:08:07 +00:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 863e8de0d3 - Show all commits

View File

@ -45,7 +45,7 @@ jobs:
id: build_site id: build_site
run: | run: |
# Overwrite the baseurl for previewonly # Overwrite the baseurl for previewonly
if [ "${{ gitea.event }}" = 'pull_request' ]; then if [ "${{ gitea.event_name }}" = 'pull_request' ]; then
echo "Overwriting baseurl for pull_request ${{ gitea.event.pull_request.number }}" echo "Overwriting baseurl for pull_request ${{ gitea.event.pull_request.number }}"
sed -i -r -e 's/^baseurl:\s*"([^"]*)"/baseurl: "\1\/${{ gitea.event.pull_request.number }}"/' _config.yml sed -i -r -e 's/^baseurl:\s*"([^"]*)"/baseurl: "\1\/${{ gitea.event.pull_request.number }}"/' _config.yml
grep "baseurl:" _config.yml grep "baseurl:" _config.yml
@ -100,5 +100,5 @@ jobs:
id: fail-on-error id: fail-on-error
if: | if: |
steps.build_site.outcome != 'success' steps.build_site.outcome != 'success'
|| (gittea.event_name == 'pull_request' && steps.deploy_site.outcome != 'success') || steps.deploy_site.outcome != 'success'
run: exit 1 run: exit 1