Action uploads to an additional URL as well, how to disable it?
Jarmos-san opened this issue · 1 comments
First off, thanks for your work, it's been an immense help!
I've been using this Action for quite a while & noticed search indexers crawling URLs which looks surprisingly like mine. It takes the form of <ALPHANUMERIC-STRING>--jarmos.netlify.app
. Suffice to say it's hurting my indexing & SEO ratings due to duplicate entries in to the index.
After digging around a bit, I figured it's the Netlify which is deploying to more than one URL. I attached a screenshot highlighting the same. Refer to it below:
How do I enable to Action to only output the production URL & nothing else?
Here's the workflow file I'm using to build the site before deploying to Netlify:
name: Netlify Deploy
on:
push:
branches:
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.82.0"
- name: Generate Static Content
run: hugo --minify
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.1.13
with:
publish-dir: "./public"
production-branch: dev
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deployed with GitHub Actions"
netlify-config-path: ./netlify.toml
github-deployment-environment: "Netlify Deploy"
enable-pull-request-comment: false
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
Am I doing something wrong or is it intended behaviour? If it's the latter, is there any way I could disable it?
Thanks!
The preview URLs in netlify should not be indexed. Netlify attaches X-Robots-Tag: noindex
header like below.
$ curl -I https:/607973ac0aadf3df4b1dce91--jarmos.netlify.app
HTTP/1.1 200 OK
Cache-Control: public, max-age=0, must-revalidate
Content-Type: text/html; charset=UTF-8
Date: Fri, 16 Apr 2021 15:19:56 GMT
Etag: "f8fa6c00ec06912b5fa59ff3db0b8bfc-ssl"
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Robots-Tag: noindex
Age: 14
Content-Length: 23507
Connection: keep-alive
Server: Netlify
X-NF-Request-ID: 3802c906-f2f8-4b19-a669-37f420fb4f2e-9843937
See the Google Search Central page below to know details.
Robots meta tag, data-nosnippet, and X-Robots-Tag specifications