From 86b39ba80af67bb0da1f897dc7ca194982d60f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0ed=C3=BD?= Date: Tue, 28 Oct 2025 00:06:26 +0100 Subject: [PATCH 1/4] fix: CI --- .github/workflows/gh-pages.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index f1a0d98..60b23ce 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -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: @@ -18,17 +18,17 @@ 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 @@ -36,9 +36,23 @@ jobs: 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 public/.nojekyll - name: Upload artifact uses: actions/upload-pages-artifact@v3 @@ -46,8 +60,8 @@ jobs: 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 }} From 631d9c5e4d9cf703faebaad469940d70968d6296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0ed=C3=BD?= Date: Tue, 28 Oct 2025 00:15:23 +0100 Subject: [PATCH 2/4] fix: CI --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 60b23ce..1b18fd7 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,4 +1,4 @@ -name: Deploy Hugo site to GitHub Pages +name: Deploy Hugo site to GitHub Pages v1 on: push: branches: [ main, js/ci ] From 580a0635f0c5e61cef4c5417f9fc836b5a6ae350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0ed=C3=BD?= Date: Tue, 28 Oct 2025 00:24:03 +0100 Subject: [PATCH 3/4] fix: CI --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 1b18fd7..c731626 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -52,7 +52,7 @@ jobs: echo "Using baseURL: $BASE_URL" hugo --minify --baseURL "$BASE_URL" # Disable Jekyll - touch public/.nojekyll + touch "$(pwd)/public/.nojekyll" - name: Upload artifact uses: actions/upload-pages-artifact@v3 From 6c6705b00b6f43f98ce1593bffd396aa61258197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0ed=C3=BD?= Date: Tue, 28 Oct 2025 00:29:24 +0100 Subject: [PATCH 4/4] fix: CI & domain --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index c731626..da8973b 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,4 +1,4 @@ -name: Deploy Hugo site to GitHub Pages v1 +name: Deploy Hugo site to GitHub Pages on: push: branches: [ main, js/ci ]