Skip to content

Commit bd7b004

Browse files
committed
Prevent Indexing of Github Pages used as Staging Sites, .htaccess and robots.txt
1 parent f678559 commit bd7b004

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,17 @@ jobs:
7575
- name: Modify .htaccess (Prevent Indexing)
7676
run: |
7777
if [[ "$BASE_URL" != "https://open-neuromorphic.org/" ]]; then
78-
sudo chmod 666 public/.htaccess # Make file fully writeable.
78+
sudo chmod 666 public/.htaccess
7979
echo "Header set X-Robots-Tag \"noindex, nofollow\"" >> public/.htaccess
8080
fi
8181
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+
8289
- name: Upload artifact
8390
uses: actions/upload-pages-artifact@v3.0.1
8491
with:

0 commit comments

Comments
 (0)