-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github action to run generate manually
- Loading branch information
Showing
12 changed files
with
159 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Generate Calendar for Rav-Hen | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branchName: | ||
description: 'Rav Hen branch to search cinemas for' | ||
required: true | ||
type: choice | ||
options: | ||
- givataiim | ||
- dizengoff | ||
- "kiryat ono" | ||
date: | ||
description: 'Date to search cinemas for formatted as YYYY-MM-DD' | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
|
||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup | ||
|
||
- run: npm run build --workspace @sofash/cli | ||
|
||
- run: node packages/cli/dist/rav-hen/scripts/create-calendar.js -b ${{ inputs.branchName }} -d ${{ inputs.date }} | ||
|
||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: './packages/cli/data' | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- generate | ||
steps: | ||
- uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NODE_ENV=development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { z } from "zod"; | ||
|
||
const envSchema = z.object({ | ||
// biome-ignore lint/style/useNamingConvention: env variables have different convention | ||
NODE_ENV: z.enum(["development", "production"]).default("development"), | ||
}); | ||
export type Env = z.infer<typeof envSchema>; | ||
|
||
export const env = envSchema.parse(process.env); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { URL } from "node:url"; | ||
|
||
export function getUrlsOfDataFiles( | ||
cinemaName: string, | ||
branchName: string, | ||
): [URL, URL] { | ||
const base = "https://vorant94.github.io/"; | ||
const icsUrl = new URL(`sofash/${cinemaName}-${branchName}.ics`, base); | ||
const jsonUrl = new URL(`sofash/${cinemaName}-${branchName}.json`, base); | ||
|
||
return [icsUrl, jsonUrl]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { URL } from "node:url"; | ||
import { cinemaIdToName } from "../types/cinema-id.js"; | ||
|
||
export const config = { | ||
baseUrl: new URL("https://www.rav-hen.co.il"), | ||
tenantId: 10104, | ||
timeZone: "Asia/Jerusalem", | ||
cinemaIdToName, | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { z } from "zod"; | ||
import type { BranchName } from "./branch-name.js"; | ||
|
||
export const branchIds = ["1058", "1071", "1062"] as const; | ||
export type BranchId = (typeof branchIds)[number]; | ||
export const branchIdSchema = z.enum(branchIds); | ||
|
||
export const branchIdToBranchName = { | ||
1058: "givataiim", | ||
1071: "dizengoff", | ||
1062: "kiryat ono", | ||
} as const satisfies Record<BranchId, BranchName>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { z } from "zod"; | ||
import type { BranchId } from "./branch-id.js"; | ||
|
||
export const branchNames = ["givataiim", "dizengoff", "kiryat ono"] as const; | ||
export type BranchName = (typeof branchNames)[number]; | ||
export const branchNameSchema = z.enum(branchNames); | ||
|
||
export const branchNameToBranchId = { | ||
givataiim: "1058", | ||
dizengoff: "1071", | ||
"kiryat ono": "1062", | ||
} as const satisfies Record<BranchName, BranchId>; |
This file was deleted.
Oops, something went wrong.