Skip to content

Commit 55f7c90

Browse files
feat: add nofollow to non-prod environments
1 parent 7e598ef commit 55f7c90

File tree

6 files changed

+13
-0
lines changed

6 files changed

+13
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
echo "REPLICA=1" >> "$GITHUB_ENV"
9696
echo "NAMESPACE=nonprod-website" >> "$GITHUB_ENV"
9797
echo 'CORS=["https://${{ env.RELEASE_NAME}}.apip.preprod-tilleuls.ovh", "http://localhost", "https://localhost", "http://localhost:3000"]' >> "$GITHUB_ENV"
98+
echo 'CADDY_X_ROBOTS_TAG="noindex, nofollow"' >> "$GITHUB_ENV"
9899
fi
99100
- name: HELM Deploy
100101
run: |
@@ -140,6 +141,7 @@ jobs:
140141
--set=github.key=${{ secrets.gh-key }} \
141142
--set=postgresql.global.postgresql.auth.password=$(openssl rand -base64 32 | tr -d "=+/") \
142143
--set=postgresql.global.postgresql.auth.username=website \
144+
--set=caddy.xRobotsTag="${{ env.CADDY_X_ROBOTS_TAG }}" \
143145
| sed --unbuffered '/USER-SUPPLIED VALUES/,$d'
144146
else
145147
helm upgrade ${{ env.RELEASE_NAME }} ./helm/api-platform \
@@ -166,6 +168,7 @@ jobs:
166168
--set=next.rootUrl=${{ env.URL }} \
167169
--set=bucket.s3Upstream=storage.googleapis.com \
168170
--set=bucket.s3Name=api-platform-website-v3 \
171+
--set=caddy.xRobotsTag="${{ env.CADDY_X_ROBOTS_TAG }}" \
169172
| sed --unbuffered '/USER-SUPPLIED VALUES/,$d'
170173
fi
171174
- name: Debug kube events

api/docker/caddy/Caddyfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,5 @@ handle {
6666

6767
reverse_proxy http://{$PWA_UPSTREAM}
6868
}
69+
70+
header X-Robots-Tag "{$CADDY_X_ROBOTS_TAG}"

docker-compose.prod.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ services:
2222
environment:
2323
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
2424
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
25+
CADDY_X_ROBOTS_TAG: ${CADDY_X_ROBOTS_TAG}
2526

2627
database:
2728
environment:

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ services:
3939
SERVER_NAME: ${SERVER_NAME:-localhost}, caddy:80
4040
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
4141
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
42+
CADDY_X_ROBOTS_TAG: ${CADDY_X_ROBOTS_TAG:-index}
4243
restart: unless-stopped
4344
volumes:
4445
- php_socket:/var/run/php

helm/api-platform/templates/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ data:
1515
next-root-url: {{ .Values.next.rootUrl | quote }}
1616
bucket-s3-upstream: {{ .Values.bucket.s3Upstream | quote }}
1717
bucket-s3-name: {{ .Values.bucket.s3Name | quote }}
18+
x-robots-tag: {{ .Values.caddy.xRobotsTag | quote }}

helm/api-platform/templates/deployment.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ spec:
5858
configMapKeyRef:
5959
name: {{ include "api-platform.fullname" . }}
6060
key: bucket-s3-name
61+
- name: CADDY_X_ROBOTS_TAG
62+
valueFrom:
63+
configMapKeyRef:
64+
name: {{ include "api-platform.fullname" . }}
65+
key: x-robots-tag
6166
ports:
6267
- name: http
6368
containerPort: 80

0 commit comments

Comments
 (0)