Skip to content
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
30 changes: 22 additions & 8 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Deploy Hugo site to GitHub Pages

on:
push:
branches:
- main
branches: [ main, js/ci ]
pull_request:
branches: [ main ]
workflow_dispatch:

permissions:
Expand All @@ -18,36 +18,50 @@ concurrency:
env:
HUGO_VERSION: "0.151.0"
HUGO_ENV: "production"
BASE_URL: "https://jsedy.com/"
PROD_BASE_URL: "https://jsedy.com/"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-depth: 1

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Build site
working-directory: jsedy.com
run: |
hugo --source jsedy.com --minify --baseURL "${BASE_URL}"
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
BASE_URL="${PROD_BASE_URL}"
else
BASE_URL="${{ steps.pages.outputs.base_url }}/"
fi

echo "Using baseURL: $BASE_URL"
hugo --minify --baseURL "$BASE_URL"
# Disable Jekyll
touch "$(pwd)/public/.nojekyll"

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: jsedy.com/public

deploy:
runs-on: ubuntu-latest
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
Loading