Pin S3 to use-west-2 and skip originals

This commit is contained in:
2026-04-03 21:16:22 -07:00
parent f04fd0fada
commit 854d473fca

View File

@@ -19,10 +19,11 @@ const DISTRIBUTION = "ELFNI2LSHJUNK";
const DIST_DIR = "dist"; const DIST_DIR = "dist";
const IMAGE_DIR = "img"; const IMAGE_DIR = "img";
const AWS_PROFILE = "push"; const AWS_PROFILE = "push";
const AWS_REGION = "us-west-2";
const credentials = fromIni({ profile: AWS_PROFILE }); const credentials = fromIni({ profile: AWS_PROFILE });
const s3 = new S3Client({ credentials }); const s3 = new S3Client({ credentials, region: AWS_REGION });
const cloudfront = new CloudFrontClient({ credentials }); const cloudfront = new CloudFrontClient({ credentials });
let existingKeysPromise: Promise<Set<string>> | null = null; let existingKeysPromise: Promise<Set<string>> | null = null;
@@ -128,6 +129,10 @@ const walkFiles = async (root: string): Promise<string[]> => {
const fullPath = path.join(root, entry.name); const fullPath = path.join(root, entry.name);
if (entry.isDirectory()) { if (entry.isDirectory()) {
if (root === IMAGE_DIR && entry.name === "original") {
continue;
}
files.push(...(await walkFiles(fullPath))); files.push(...(await walkFiles(fullPath)));
continue; continue;
} }