File tree 1 file changed +21
-4
lines changed
1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 4
4
push :
5
5
branches : ["main"]
6
6
7
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
8
7
permissions :
9
8
contents : read
10
9
pages : write
11
10
id-token : write
12
11
13
- # Environment variables available to all jobs and steps in this workflow
14
12
env :
15
13
HUGO_ENV : production
16
14
HUGO_VERSION : " 0.118.2"
17
15
GO_VERSION : " 1.20.5"
18
16
NODE_VERSION : " 18.15.0"
19
17
20
18
jobs :
21
- # Build job
22
19
build :
23
20
runs-on : ubuntu-24.04-arm
24
21
steps :
@@ -65,15 +62,35 @@ jobs:
65
62
66
63
- name : Modify hugo.toml
67
64
run : sed -i "s|baseURL = .*|baseURL = \"$BASE_URL\"|" hugo.toml
65
+
66
+ - name : Create public directory
67
+ run : mkdir -p public
68
+
69
+ - name : Create .htaccess (if needed)
70
+ run : touch public/.htaccess
71
+
68
72
- name : Build site
69
73
run : npm run build
70
74
75
+ - name : Modify .htaccess (Prevent Indexing)
76
+ run : |
77
+ if [[ "$BASE_URL" != "https://open-neuromorphic.org/" ]]; then
78
+ sudo chmod 666 public/.htaccess
79
+ echo "Header set X-Robots-Tag \"noindex, nofollow\"" >> public/.htaccess
80
+ fi
81
+
82
+ - name : Create robots.txt (Prevent Indexing)
83
+ run : |
84
+ if [[ "$BASE_URL" != "https://open-neuromorphic.org/" ]]; then
85
+ echo "User-agent: *" > public/robots.txt
86
+ echo "Disallow: /" >> public/robots.txt
87
+ fi
88
+
71
89
- name : Upload artifact
72
90
uses : actions/upload-pages-artifact@v3.0.1
73
91
with :
74
92
path : ./public
75
93
76
- # Deployment job
77
94
deploy :
78
95
environment :
79
96
name : github-pages
You can’t perform that action at this time.
0 commit comments