Skip to content

Commit e446474

Browse files
authored
fix: missing env FRONTEND_URL for render.ts (openRin#106)
1 parent c1c9d73 commit e446474

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/seo.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
3737
S3_REGION: ${{ vars.S3_REGION }}
3838
S3_ENDPOINT: ${{ vars.S3_ENDPOINT }}
39+
FRONTEND_URL: ${{ vars.FRONTEND_URL }}
3940
SEO_BASE_URL: ${{ vars.SEO_BASE_URL }}
4041
SEO_CONTAINS_KEY: ${{ vars.SEO_CONTAINS_KEY }}
4142
S3_ACCESS_HOST: ${{ vars.S3_ACCESS_HOST }}

scripts/render.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ async function saveFile(filename: string, data: string) {
4545
// Save data to file
4646
console.log(`Saving ${filename}`);
4747
const url = new URL(filename)
48-
let fullname = path.join(folder, url.pathname + url.search.replace('?', '&'))
49-
if (fullname.endsWith('/')) {
50-
fullname += 'index.html';
48+
let fileName = path.join(folder, url.pathname + url.search.replace('?', '&'))
49+
if (fileName.endsWith('/')) {
50+
fileName += 'index.html';
5151
}
5252
try {
53-
await s3.send(new PutObjectCommand({ Bucket: bucket, Key: fullname, Body: data, ContentType: 'text/html' }))
54-
console.info(`Saved ${accessHost}/${fullname}.`)
53+
await s3.send(new PutObjectCommand({ Bucket: bucket, Key: fileName, Body: data, ContentType: 'text/html' }))
54+
console.info(`Saved ${accessHost}/${fileName}.`)
5555
} catch (e: any) {
5656
console.error(e.message)
5757
}

0 commit comments

Comments
 (0)