@@ -2,7 +2,7 @@ name: Deploy Hugo site to Pages
2
2
3
3
on :
4
4
push :
5
- branches : ["main", "refactor-merge "]
5
+ branches : ["main", "design-adjustments "]
6
6
7
7
permissions :
8
8
contents : read
13
13
HUGO_ENV : production
14
14
HUGO_VERSION : " 0.147.7"
15
15
GO_VERSION : " 1.24.3"
16
- NODE_VERSION : " 22.16.0 "
16
+ NODE_VERSION : " 22.x " # Use major version for setup-node
17
17
18
18
jobs :
19
19
build :
20
- runs-on : ubuntu-24.04-arm
20
+ # Switched to a standard x86_64 runner for better package compatibility
21
+ runs-on : ubuntu-24.04
21
22
steps :
22
23
- name : Install Hugo
23
24
run : |
24
- wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-arm64.deb \
25
+ # Updated to use amd64 for the new runner
26
+ wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
25
27
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
26
28
27
29
- name : Install Go
28
30
run : |
29
- # Corrected to download linux-arm64 for ARM runner
30
- wget -O ${{ runner.temp }}/go.tar.gz https://go.dev/dl/go${GO_VERSION}.linux-arm64 .tar.gz \
31
+ # Updated to use amd64 for the new runner
32
+ wget -O ${{ runner.temp }}/go.tar.gz https://go.dev/dl/go${GO_VERSION}.linux-amd64 .tar.gz \
31
33
&& sudo tar -C /usr/local -xzf ${{ runner.temp }}/go.tar.gz \
32
- && sudo ln -s /usr/local/go/bin/go /usr/local/bin/go # Ensure go is in PATH
34
+ && sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
33
35
34
36
- name : Install wkhtmltopdf
35
37
run : |
46
48
id : pages
47
49
uses : actions/configure-pages@v5
48
50
51
+ # Best practice: Use setup-node with caching
52
+ - name : Setup Node.js
53
+ uses : actions/setup-node@v4
54
+ with :
55
+ node-version : ${{ env.NODE_VERSION }}
56
+ cache : ' npm'
57
+
49
58
- name : Install npm dependencies
50
- run : npm install
59
+ run : npm ci # Use npm ci for faster, more reliable CI builds
51
60
52
61
- name : Determine Base URL
53
62
id : base_url
82
91
- name : Create and Populate .htaccess
83
92
run : |
84
93
echo "Creating and populating .htaccess in public directory"
85
- # Ensure public directory exists (though npm run build should create it)
86
94
mkdir -p public
87
95
cat .github/config/htaccess.template > public/.htaccess
88
96
echo ".htaccess created and populated."
@@ -94,10 +102,8 @@ jobs:
94
102
echo "Current BASE_URL for .htaccess modification: $BASE_URL"
95
103
if [[ "$BASE_URL" != "https://open-neuromorphic.org/" ]]; then
96
104
echo "Modifying .htaccess to prevent indexing for $BASE_URL"
97
- # The file is created by the workflow user, sudo likely not needed for chmod.
98
- # If issues persist, can use sudo, but check file ownership first.
99
- chmod u+w public/.htaccess # Ensure user has write permission
100
- echo "" >> public/.htaccess # Add a newline for separation
105
+ chmod u+w public/.htaccess
106
+ echo "" >> public/.htaccess
101
107
echo "# Rules to prevent indexing on non-production deployments" >> public/.htaccess
102
108
echo "Header set X-Robots-Tag \"noindex, nofollow\"" >> public/.htaccess
103
109
echo ".htaccess modified."
@@ -130,7 +136,8 @@ jobs:
130
136
environment :
131
137
name : github-pages
132
138
url : ${{ steps.deployment.outputs.page_url }}
133
- runs-on : ubuntu-24.04-arm
139
+ # Switched to a standard x86_64 runner for consistency
140
+ runs-on : ubuntu-24.04
134
141
needs : build
135
142
steps :
136
143
- name : Deploy to GitHub Pages
0 commit comments