Skip to content

Commit

Permalink
chore: use s3 bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Nov 16, 2023
1 parent b7c9e21 commit 0dec951
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 11 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,6 @@ jobs:
fi
echo "URL=$RELEASE_NAME.apip.preprod-tilleuls.ovh" >> "$GITHUB_ENV"
fi
- name: Fetch documentation
working-directory: ./pwa
run: bash tools/get-docs.sh
- name: Compute source documentation
working-directory: ./pwa
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: phive
run: bash tools/get-core-docs.sh
- name: Build and push
uses: docker/build-push-action@v4
with:
Expand Down
22 changes: 21 additions & 1 deletion api/docker/caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,27 @@ log {
output file /var/log/caddy/access.log
}

route {
@docsroot path_regexp ^/docs(/?)$
@defaultdocs path_regexp ^/docs/distribution(.*)
redir @docsroot /docs/3.2/distribution
redir @defaultdocs /docs/3.2/distribution{1}

@version path_regexp version (/docs/[^/]+)$
redir @version {re.version.1}/distribution

handle_path /docs/* {
# you could ADD ./docs /srv/app/docs and use this for development
# root * /srv/app/docs
# file_server

reverse_proxy {$BUCKET_S3_UPSTREAM} {
header_up Host {http.reverse_proxy.upstream.hostport}
}

# rewrite * /{$BUCKET_S3_NAME}{path}
}

handle {
# Disable Topics tracking if not enabled explicitly: https://github.com/jkarlin/topics
header ?Permissions-Policy "browsing-topics=()"

Expand Down
2 changes: 2 additions & 0 deletions helm/api-platform/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ data:
mercure-url: "http://{{ include "api-platform.fullname" . }}/.well-known/mercure"
mercure-public-url: {{ .Values.mercure.publicUrl | default "http://127.0.0.1/.well-known/mercure" | quote }}
next-root-url: {{ .Values.next.rootUrl | quote }}
bucket-s3-upstream: {{ .Values.bucket.s3Upstream | quote }}
bucket-s3-name: {{ .Values.bucket.s3Name | quote }}
10 changes: 10 additions & 0 deletions helm/api-platform/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ spec:
secretKeyRef:
name: {{ include "api-platform.fullname" . }}
key: mercure-jwt-secret
- name: BUCKET_S3_UPSTREAM
valueFrom:
configMapKeyRef:
name: {{ include "api-platform.fullname" . }}
key: bucket-s3-upstream
- name: BUCKET_S3_NAME
valueFrom:
configMapKeyRef:
name: {{ include "api-platform.fullname" . }}
key: bucket-s3-name
ports:
- name: http
containerPort: 80
Expand Down
4 changes: 4 additions & 0 deletions helm/api-platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ next:

github:
key: changeMe

bucket:
s3Upstream: ChangeMe
s3Name: ChangeMe

caddy:
image:
Expand Down
1 change: 1 addition & 0 deletions pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"postbuild": "ts-node ./postbuild.ts"
},
"dependencies": {
"@docsearch/css": "^3.5.2",
"@docsearch/react": "^3.5.2",
"@formatjs/intl-localematcher": "^0.2.32",
"@mdx-js/loader": "^2.3.0",
Expand Down
3 changes: 3 additions & 0 deletions pwa/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0dec951

Please sign in to comment.