Skip to content

Commit

Permalink
Set robots meta tag content "noindex, nofollow" for gh-pages preview
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyfok committed Jul 31, 2024
1 parent 21de5a2 commit 1ddf38b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/export-static-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
uses: actions/configure-pages@v5

- name: Run "docker compose up" to export static site for RiskProfiler
run: |
Expand All @@ -53,11 +53,6 @@ jobs:
export OPTIONS_GIT_DESCRIBE=$(git describe --long --tags)
docker compose up --abort-on-container-exit --exit-code-from wpcli
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: html_static/riskprofiler

- name: Upload debug log artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -82,6 +77,17 @@ jobs:
tags: true
draft: false

- name: Discourage search engines from indexing this preview site
run: |
for i in $(grep -lr '^<meta name="robots"' html_static/riskprofiler); do
sed -i '/^<meta name="robots"/s/content="[^"]\+"/content="noindex, nofollow"/' $i
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: html_static/riskprofiler

# Deployment job
deploy:
# Add a dependency to the build job
Expand Down

0 comments on commit 1ddf38b

Please sign in to comment.