Skip to content

Commit f3502b5

Browse files
committed
try different upload artifact version for build
1 parent 81c23ac commit f3502b5

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
# Sample workflow for building and deploying a Hugo site to GitHub Pages
21
name: Deploy Hugo site to Pages
32

43
on:
5-
# Runs on pushes targeting the default branch
64
push:
75
branches: ["main"]
86

9-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
107
permissions:
118
contents: read
129
pages: write
1310
id-token: write
1411

15-
# Environment variables available to all jobs and steps in this workflow
1612
env:
1713
HUGO_ENV: production
1814
HUGO_VERSION: "0.118.2"
1915
GO_VERSION: "1.20.5"
2016
NODE_VERSION: "18.15.0"
2117

2218
jobs:
23-
# Build job
2419
build:
2520
runs-on: ubuntu-24.04-arm
2621
steps:
@@ -50,6 +45,20 @@ jobs:
5045
- name: Install npm dependencies
5146
run: npm install
5247

48+
- name: Determine Base URL
49+
id: base_url
50+
run: |
51+
REPO_NAME=$(echo "${{ github.repository }}" | cut -d '/' -f 2)
52+
if [[ "${{ github.repository_owner }}" == "${{ github.repository_owner }}" ]]; then
53+
BASE_URL="https://${{ github.repository_owner }}.github.io/${REPO_NAME}/"
54+
else
55+
BASE_URL="https://${{ github.repository_owner }}.github.io/"
56+
fi
57+
echo "BASE_URL=$BASE_URL" >> $GITHUB_ENV
58+
59+
- name: Modify hugo.toml
60+
run: sed -i "s|baseURL = .*|baseURL = \"$BASE_URL\"|" hugo.toml
61+
5362
- name: Build site
5463
run: npm run build
5564

@@ -58,7 +67,6 @@ jobs:
5867
with:
5968
path: ./public
6069

61-
# Deployment job
6270
deploy:
6371
environment:
6472
name: github-pages

0 commit comments

Comments
 (0)