Skip to content

Commit

Permalink
Refactor: Changed configs to fly volumes (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntGa committed Sep 23, 2024
1 parent ee205ce commit 8069ee1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- ORAKEI-Staging
- ORAKEI-Fly-Volume

jobs: # remove these tests in production - Anton
test-vars:
Expand Down
4 changes: 4 additions & 0 deletions fly.staging.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ primary_region = 'syd'
memory = '1gb'
cpu_kind = 'shared'
cpus = 1

[mounts]
source = "local_data"
destination = "/data"
4 changes: 2 additions & 2 deletions src/scripts/getHomepageDescriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export async function getHomepageDescriptions(): Promise<void> {
if (!NOTION_TOKEN || !NOTION_HOMEPAGE_ID) throw new Error("Missing secret(s)");

const notion = new Client({ auth: NOTION_TOKEN });
const publicFolderPath = path.join(process.cwd(), 'public');
const homepageFolderPath = path.join(publicFolderPath, 'homepage');
const homepageFolderPath = path.join('/data', 'homepage');


// Ensure the 'homepage' directory exists
await ensureDirectoryExists(homepageFolderPath);
Expand Down
5 changes: 2 additions & 3 deletions src/scripts/getMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ export async function getMembers(): Promise<Member[]> {
};
});

const publicFolderPath = path.join(process.cwd(), 'public');
const membersFolderPath = path.join(publicFolderPath, 'members'); // Path for storing member images
const jsonFilePath = path.join(membersFolderPath, 'membersData.json'); // Path for storing members data in JSON
const membersFolderPath = path.join('/data', 'members'); // Store images in Fly.io volume
const jsonFilePath = path.join(membersFolderPath, 'membersData.json'); // Path for storing members data in JSONath for storing members data in JSON

// Ensure the 'members' directory exists
await ensureDirectoryExists(membersFolderPath);
Expand Down
5 changes: 2 additions & 3 deletions src/scripts/getProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ export async function getProjects(): Promise<{ projects: ProjectData[], carousel
}

const notion = new Client({ auth: NOTION_TOKEN });
const publicFolderPath = path.join(process.cwd(), 'public');
const projectsFolderPath = path.join(publicFolderPath, 'projects');
const projectsFolderPath = path.join('/data', 'projects');

await ensureDirectoryExists(projectsFolderPath);

Expand Down Expand Up @@ -124,7 +123,7 @@ export async function getProjects(): Promise<{ projects: ProjectData[], carousel
fs.writeFileSync(projectsJsonPath, JSON.stringify(filteredProjects, null, 2));
console.log(`Projects data saved to ${projectsJsonPath}`);

const carouselJsonPath = path.join(projectsFolderPath, 'carouselList.json');
const carouselJsonPath = path.join(projectsFolderPath, 'carouselList.json');
fs.writeFileSync(carouselJsonPath, JSON.stringify(carouselList, null, 2));
console.log(`Carousel list data saved to ${carouselJsonPath}`);

Expand Down

0 comments on commit 8069ee1

Please sign in to comment.