Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
echo 'CORS=["https://api-platform.com", "http://localhost", "https://localhost", "http://localhost:3000"]' >> "$GITHUB_ENV"
echo "NAMESPACE=prod-website" >> "$GITHUB_ENV"
echo "REPLICA=1" >> "$GITHUB_ENV"
echo 'CADDY_X_ROBOTS_TAG="all"' >> "$GITHUB_ENV"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else
CONTEXT=nonprod
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
Expand All @@ -95,6 +96,7 @@ jobs:
echo "REPLICA=1" >> "$GITHUB_ENV"
echo "NAMESPACE=nonprod-website" >> "$GITHUB_ENV"
echo 'CORS=["https://${{ env.RELEASE_NAME}}.apip.preprod-tilleuls.ovh", "http://localhost", "https://localhost", "http://localhost:3000"]' >> "$GITHUB_ENV"
echo 'CADDY_X_ROBOTS_TAG="noindex, nofollow"' >> "$GITHUB_ENV"
fi
- name: HELM Deploy
run: |
Expand Down Expand Up @@ -140,6 +142,7 @@ jobs:
--set=github.key=${{ secrets.gh-key }} \
--set=postgresql.global.postgresql.auth.password=$(openssl rand -base64 32 | tr -d "=+/") \
--set=postgresql.global.postgresql.auth.username=website \
--set=caddy.xRobotsTag="${{ env.CADDY_X_ROBOTS_TAG }}" \
| sed --unbuffered '/USER-SUPPLIED VALUES/,$d'
else
helm upgrade ${{ env.RELEASE_NAME }} ./helm/api-platform \
Expand All @@ -166,6 +169,7 @@ jobs:
--set=next.rootUrl=${{ env.URL }} \
--set=bucket.s3Upstream=storage.googleapis.com \
--set=bucket.s3Name=api-platform-website-v3 \
--set=caddy.xRobotsTag="${{ env.CADDY_X_ROBOTS_TAG }}" \
| sed --unbuffered '/USER-SUPPLIED VALUES/,$d'
fi
- name: Debug kube events
Expand Down
2 changes: 2 additions & 0 deletions api/docker/caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ handle {

reverse_proxy http://{$PWA_UPSTREAM}
}

header X-Robots-Tag "{$CADDY_X_ROBOTS_TAG}"
1 change: 1 addition & 0 deletions helm/api-platform/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ data:
next-root-url: {{ .Values.next.rootUrl | quote }}
bucket-s3-upstream: {{ .Values.bucket.s3Upstream | quote }}
bucket-s3-name: {{ .Values.bucket.s3Name | quote }}
x-robots-tag: {{ .Values.caddy.xRobotsTag | quote }}
5 changes: 5 additions & 0 deletions helm/api-platform/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ spec:
configMapKeyRef:
name: {{ include "api-platform.fullname" . }}
key: bucket-s3-name
- name: CADDY_X_ROBOTS_TAG
valueFrom:
configMapKeyRef:
name: {{ include "api-platform.fullname" . }}
key: x-robots-tag
ports:
- name: http
containerPort: 80
Expand Down