Skip to content

Commit 08094be

Browse files
committed
text fix json
1 parent e229f9c commit 08094be

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ jobs:
5959
id: meta
6060
run: |
6161
set -o pipefail
62+
CORS_LOCALHOST="http://localhost|https://localhost|http://localhost:3000"
6263
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
6364
# Tags are deployed in prod
6465
CONTEXT=prod
65-
echo 'cors=["https://api-platform.com", "http://localhost", "https://localhost", "http://localhost:3000"]' >> "$GITHUB_ENV"
66+
CORS=$(echo "^https://api-platform.com|$CORS_LOCALHOST$" | sed 's/\./\\./g' )
6667
ENVIRONMENT=prod
6768
NAMESPACE=prod-website
6869
RELEASE_NAME=website-prod
@@ -77,7 +78,7 @@ jobs:
7778
ENVIRONMENT=Staging
7879
RELEASE_NAME=${{ github.ref_name }}
7980
fi
80-
echo 'cors=["https://${{ env.RELEASE_NAME}}.apip.preprod-tilleuls.ovh", "http://localhost", "https://localhost", "http://localhost:3000"]' >> "$GITHUB_ENV"
81+
CORS=$(echo "^https://${{ env.RELEASE_NAME}}.apip.preprod-tilleuls.ovh|$CORS_LOCALHOST$" | sed 's/\./\\./g' )
8182
NAMESPACE=nonprod-website
8283
REPLICA=1
8384
URL=$RELEASE_NAME.apip.preprod-tilleuls.ovh
@@ -155,22 +156,22 @@ jobs:
155156
--set=ingress.hosts[0].host=${{ needs.meta.outputs.url }} \
156157
--set=ingress.hosts[0].paths[0].path=/ \
157158
--set=ingress.hosts[0].paths[0].pathType=ImplementationSpecific \
158-
--set=ingress.tls[0].hosts[0]=${{ env.URL }} \
159+
--set=ingress.tls[0].hosts[0]=${{ needs.meta.outputs.url }} \
159160
--set=ingress.annotations."cert-manager\.io/cluster-issuer"=letsencrypt-production \
160161
--set=ingress.tls[0].secretName=${{ needs.meta.outputs.release_name }}-website-ssl \
161162
--set=php.jwt.secretKey="$JWT_SECRET_KEY" \
162163
--set=php.jwt.publicKey="$(openssl pkey -in <(echo "$JWT_SECRET_KEY") -passin file:<(echo "$JWT_PASSPHRASE") -pubout)" \
163164
--set=php.jwt.passphrase=$JWT_PASSPHRASE \
164-
--set=php.corsAllowOrigin="^$(echo "${{ join(fromJSON(needs.meta.outputs.cors), '|') }}" | sed 's/\./\\./g')$" \
165-
--set=php.host=${{ env.URL }} \
166-
--set=next.rootUrl=${{ env.URL }} \
165+
--set=php.corsAllowOrigin=${{ needs.meta.outputs.cors }} \
166+
--set=php.host=${{ needs.meta.outputs.url }} \
167+
--set=next.rootUrl=${{ needs.meta.outputs.url }} \
167168
--set=github.key=${{ secrets.gh-key }} \
168169
--set=postgresql.global.postgresql.auth.password=${{ secrets.pgpasswd }} \
169170
--set=postgresql.global.postgresql.auth.username=website \
170171
| sed --unbuffered '/USER-SUPPLIED VALUES/,$d'
171172
- name: Debug kube events
172173
if: failure()
173-
run: kubectl get events --namespace=${{ env.NAMESPACE }} --sort-by .metadata.creationTimestamp
174+
run: kubectl get events --namespace=${{ needs.meta.outputs.namespace }} --sort-by .metadata.creationTimestamp
174175

175176
links:
176177
name: Check for dead links

0 commit comments

Comments
 (0)