mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
branch names
This commit is contained in:
1 parent
c5bb537bf2
commit
5bda754b6e
10 files changed
+22
-124
No files matched your search
@@ -1,55 +0,0 @@
|
|||||||
name: Averages
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 8 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
|
||||||
ALLOW_ROBOTS: "true"
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
|
||||||
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
|
||||||
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: Build averages
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_BRANCH: main
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
|
|
||||||
run: bun run build:averages --production
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
name: Reviews
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: 0 0 * * 2
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: Find reviews
|
|
||||||
run: bun run build:reviews
|
|
||||||
@@ -31,10 +31,8 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PUBLIC_ENVIRONMENT: ${{ inputs.environment || 'beta' }}
|
|
||||||
|
|
||||||
# blitzkit
|
# blitzkit
|
||||||
PUBLIC_BRANCH: main
|
PUBLIC_ENVIRONMENT: ${{ inputs.environment || 'beta' }}
|
||||||
PUBLIC_PROMOTE_OPENTEST: false
|
PUBLIC_PROMOTE_OPENTEST: false
|
||||||
PUBLIC_STATIC_ASSET_BASE: https://assets.blitzkit.app
|
PUBLIC_STATIC_ASSET_BASE: https://assets.blitzkit.app
|
||||||
PUBLIC_GUIDE_WEBSITE: https://guidesblitz.com
|
PUBLIC_GUIDE_WEBSITE: https://guidesblitz.com
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ If you intend to contribute to the code, note that you may need to check out sen
|
|||||||
| `GOOGLE_APPLICATION_CREDENTIALS` | [Google Cloud](https://cloud.google.com/) | | Google Cloud's API key, primarily used for ranking popular tanks and finding relevant tank review videos in Tankopedia. |
|
| `GOOGLE_APPLICATION_CREDENTIALS` | [Google Cloud](https://cloud.google.com/) | | Google Cloud's API key, primarily used for ranking popular tanks and finding relevant tank review videos in Tankopedia. |
|
||||||
| `PUBLIC_DISCORD_SERVER_ID` | [BlitzKit Discord Server](https://discord.gg/nDt7AjGJQH) | `734786591205359697` | BlitzKit Discord Server's id. |
|
| `PUBLIC_DISCORD_SERVER_ID` | [BlitzKit Discord Server](https://discord.gg/nDt7AjGJQH) | `734786591205359697` | BlitzKit Discord Server's id. |
|
||||||
| `PUBLIC_ASSET_BASE` | [blitzkit/assets](https://github.com/blitzkit/assets) | `https://blitzkit.github.io/assets` | The root domain and path that serves the external assets like tank models and icons. |
|
| `PUBLIC_ASSET_BASE` | [blitzkit/assets](https://github.com/blitzkit/assets) | `https://blitzkit.github.io/assets` | The root domain and path that serves the external assets like tank models and icons. |
|
||||||
| `PUBLIC_BRANCH` | | `main` | The branch that the website is operating on. This is completely nominal. |
|
|
||||||
| `PUBLIC_GUIDE_WEBSITE` | [GuidesBlitz](https://guidesblitz.com/) | `https://guidesblitz.com` | The website that serves the encyclopedia-like content in BlitzKit. |
|
| `PUBLIC_GUIDE_WEBSITE` | [GuidesBlitz](https://guidesblitz.com/) | `https://guidesblitz.com` | The website that serves the encyclopedia-like content in BlitzKit. |
|
||||||
| `SERVICING` | | `false` | Wether the website is down for servicing. |
|
| `SERVICING` | | `false` | Wether the website is down for servicing. |
|
||||||
| `GH_TOKEN` | [GitHub Fine-Grained Tokens](https://github.com/settings/personal-access-tokens) | | The GitHub API key used for checking out private submodules and pushing content to the asset repository. |
|
| `GH_TOKEN` | [GitHub Fine-Grained Tokens](https://github.com/settings/personal-access-tokens) | | The GitHub API key used for checking out private submodules and pushing content to the asset repository. |
|
||||||
|
|||||||
@@ -43,10 +43,11 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"branches": {
|
"branches": {
|
||||||
"local": "dev",
|
"beta": "Beta",
|
||||||
"dev": "beta",
|
"development": "Development",
|
||||||
"opentest": "opentest",
|
"opentest": "OpenTest",
|
||||||
"preview": "preview"
|
"preview": "Preview",
|
||||||
|
"production": "Production"
|
||||||
},
|
},
|
||||||
|
|
||||||
"locales": {
|
"locales": {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const gameDefinitions = await api.gameDefinitions();
|
const gameDefinitions = await api.gameDefinitions();
|
||||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
const environment = assertSecret(import.meta.env.PUBLIC_ENVIRONMENT);
|
||||||
const { locale } = Astro.props;
|
const { locale } = Astro.props;
|
||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
---
|
---
|
||||||
@@ -135,7 +135,7 @@ const strings = getStrings(locale);
|
|||||||
<Flex direction="column" gap="1" flexGrow="1" flexBasis="0" align="end">
|
<Flex direction="column" gap="1" flexGrow="1" flexBasis="0" align="end">
|
||||||
<Text size="2" color="gray">BlitzKit</Text>
|
<Text size="2" color="gray">BlitzKit</Text>
|
||||||
{
|
{
|
||||||
PUBLIC_ASSET_BRANCH !== "preview" && (
|
environment !== "preview" && (
|
||||||
<Text size="2" color="gray">
|
<Text size="2" color="gray">
|
||||||
WoTB
|
WoTB
|
||||||
</Text>
|
</Text>
|
||||||
@@ -149,14 +149,14 @@ const strings = getStrings(locale);
|
|||||||
{packageJson.version}
|
{packageJson.version}
|
||||||
</Code>
|
</Code>
|
||||||
{
|
{
|
||||||
PUBLIC_ASSET_BRANCH !== "preview" && (
|
environment !== "preview" && (
|
||||||
<Code size="2" color="gray">
|
<Code size="2" color="gray">
|
||||||
{gameDefinitions.version}
|
{gameDefinitions.version}
|
||||||
</Code>
|
</Code>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<Code size="2" color="gray">
|
<Code size="2" color="gray">
|
||||||
{PUBLIC_ASSET_BRANCH}
|
{environment}
|
||||||
</Code>
|
</Code>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
@@ -168,7 +168,7 @@ const strings = getStrings(locale);
|
|||||||
</Code>
|
</Code>
|
||||||
|
|
||||||
{
|
{
|
||||||
PUBLIC_ASSET_BRANCH !== "preview" && (
|
environment !== "preview" && (
|
||||||
<>
|
<>
|
||||||
<Text size="2" color="gray">
|
<Text size="2" color="gray">
|
||||||
WoTB
|
WoTB
|
||||||
@@ -182,7 +182,7 @@ const strings = getStrings(locale);
|
|||||||
|
|
||||||
<Text size="2" color="gray">CDN</Text>
|
<Text size="2" color="gray">CDN</Text>
|
||||||
<Code size="2" color="gray">
|
<Code size="2" color="gray">
|
||||||
{PUBLIC_ASSET_BRANCH}
|
{environment}
|
||||||
</Code>
|
</Code>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
@@ -5,7 +5,7 @@ import { Button, Code, Flex, Link, Text } from "@radix-ui/themes";
|
|||||||
export function Plugs() {
|
export function Plugs() {
|
||||||
const promoteOpentest =
|
const promoteOpentest =
|
||||||
assertSecret(import.meta.env.PUBLIC_PROMOTE_OPENTEST) === "true" &&
|
assertSecret(import.meta.env.PUBLIC_PROMOTE_OPENTEST) === "true" &&
|
||||||
assertSecret(import.meta.env.PUBLIC_BRANCH) !== "opentest";
|
assertSecret(import.meta.env.PUBLIC_ENVIRONMENT) !== "opentest";
|
||||||
const promotions = [promoteOpentest];
|
const promotions = [promoteOpentest];
|
||||||
|
|
||||||
if (promotions.every((promotion) => !promotion)) return null;
|
if (promotions.every((promotion) => !promotion)) return null;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const tankDefinitions = await api.tankDefinitions();
|
|||||||
export function CalloutsSection() {
|
export function CalloutsSection() {
|
||||||
const tank = Duel.use((state) => state.protagonist.tank);
|
const tank = Duel.use((state) => state.protagonist.tank);
|
||||||
const promoteAeson =
|
const promoteAeson =
|
||||||
assertSecret(import.meta.env.PUBLIC_BRANCH) === "preview";
|
assertSecret(import.meta.env.PUBLIC_ENVIRONMENT) === "preview";
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
TankopediaPersistent.mutate((draft) => {
|
TankopediaPersistent.mutate((draft) => {
|
||||||
|
|||||||
@@ -3,19 +3,12 @@ import { STRINGS } from "@blitzkit/i18n";
|
|||||||
import locales from "@blitzkit/i18n/locales.json";
|
import locales from "@blitzkit/i18n/locales.json";
|
||||||
|
|
||||||
export function resolveBranchName(locale: string = locales.default) {
|
export function resolveBranchName(locale: string = locales.default) {
|
||||||
if (!(locale in STRINGS)) throw new Error(`Unsupported locale: ${locale}`);
|
|
||||||
|
|
||||||
const strings = STRINGS[locale];
|
const strings = STRINGS[locale];
|
||||||
const secret = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
const environment = assertSecret(import.meta.env.PUBLIC_ENVIRONMENT);
|
||||||
|
|
||||||
if (
|
if (environment === "production") return undefined;
|
||||||
assertSecret(import.meta.env.MODE) === "development" &&
|
|
||||||
secret === "dev"
|
return strings.common.branches[
|
||||||
) {
|
environment as keyof typeof strings.common.branches
|
||||||
return strings.common.branches.local;
|
];
|
||||||
} else {
|
|
||||||
return (strings.common.branches as Record<string, string>)[secret] as
|
|
||||||
| string
|
|
||||||
| undefined;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,7 @@ import { getStaticPaths as _getStaticPaths } from "../_index";
|
|||||||
|
|
||||||
const MAX_TOOLS_PER_ROW = 2;
|
const MAX_TOOLS_PER_ROW = 2;
|
||||||
|
|
||||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
const environment = assertSecret(import.meta.env.PUBLIC_ENVIRONMENT);
|
||||||
const { locale } = Astro.props;
|
const { locale } = Astro.props;
|
||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
const rows: Tool[][] = [];
|
const rows: Tool[][] = [];
|
||||||
@@ -88,7 +88,7 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
|
|||||||
<Plugs client:idle />
|
<Plugs client:idle />
|
||||||
|
|
||||||
{
|
{
|
||||||
PUBLIC_ASSET_BRANCH === "preview" && (
|
environment === "preview" && (
|
||||||
<Flex justify="center" my="8" px="4">
|
<Flex justify="center" my="8" px="4">
|
||||||
<AesonPlug />
|
<AesonPlug />
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
Reference in new issue
Block a user