mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: branch
This commit is contained in:
1 parent
470869418c
commit
abebfcf6c6
9 files changed
+10
-9
No files matched your search
@@ -28,6 +28,7 @@ env:
|
||||
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 }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -8,7 +8,7 @@ import { LinkI18n } from './LinkI18n';
|
||||
import { LocaleSwitcherThemeWrapper } from './LocaleSwitcher';
|
||||
|
||||
const gameDefinitions = await fetchGameDefinitions();
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||
const strings = getStrings(locale);
|
||||
---
|
||||
|
||||
@@ -139,7 +139,7 @@ const strings = getStrings(locale);
|
||||
toolsFiltered.map((tool) => {
|
||||
const unavailableOnBranch = tool.branches?.every(
|
||||
(branch) =>
|
||||
branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH),
|
||||
branch !== assertSecret(import.meta.env.PUBLIC_BRANCH),
|
||||
);
|
||||
const selected = Astro.url.pathname.includes(`/${tool.id}`);
|
||||
const toolStrings =
|
||||
@@ -211,7 +211,7 @@ const strings = getStrings(locale);
|
||||
toolsFiltered.map((tool) => {
|
||||
const unavailableOnBranch = tool.branches?.every(
|
||||
(branch) =>
|
||||
branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH),
|
||||
branch !== assertSecret(import.meta.env.PUBLIC_BRANCH),
|
||||
);
|
||||
|
||||
if (unavailableOnBranch) return null;
|
||||
|
||||
@@ -14,7 +14,7 @@ export function Plugs() {
|
||||
function Content() {
|
||||
const promoteOpentest =
|
||||
assertSecret(import.meta.env.PUBLIC_PROMOTE_OPENTEST) === 'true' &&
|
||||
assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) !== 'opentest';
|
||||
assertSecret(import.meta.env.PUBLIC_BRANCH) !== 'opentest';
|
||||
const promotions = [promoteOpentest];
|
||||
|
||||
if (promotions.every((promotion) => !promotion)) return null;
|
||||
|
||||
@@ -15,7 +15,7 @@ export function CalloutsSection() {
|
||||
const tank = Duel.use((state) => state.protagonist.tank);
|
||||
const mutateTankopediaPersistent = TankopediaPersistent.useMutation();
|
||||
const promoteAeson =
|
||||
assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) === 'preview';
|
||||
assertSecret(import.meta.env.PUBLIC_BRANCH) === 'preview';
|
||||
|
||||
useEffect(() => {
|
||||
mutateTankopediaPersistent((draft) => {
|
||||
|
||||
@@ -12,7 +12,7 @@ interface Props {
|
||||
|
||||
const { tool } = Astro.props;
|
||||
const disabled = tool.branches?.every(
|
||||
(branch) => branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH),
|
||||
(branch) => branch !== assertSecret(import.meta.env.PUBLIC_BRANCH),
|
||||
);
|
||||
const { locale } = Astro.params;
|
||||
const strings = getStrings(locale);
|
||||
@@ -108,7 +108,7 @@ const toolStrings =
|
||||
disabled ? (
|
||||
<>
|
||||
Unavailable on{' '}
|
||||
<Code>{assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH)}</Code>
|
||||
<Code>{assertSecret(import.meta.env.PUBLIC_BRANCH)}</Code>
|
||||
</>
|
||||
) : (
|
||||
toolStrings.description
|
||||
|
||||
@@ -5,7 +5,7 @@ export function resolveBranchName(locale: string = DEFAULT_LOCALE) {
|
||||
if (!(locale in STRINGS)) throw new Error(`Unsupported locale: ${locale}`);
|
||||
|
||||
const strings = STRINGS[locale as SupportedLocale];
|
||||
const secret = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
||||
const secret = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
|
||||
if (
|
||||
assertSecret(import.meta.env.MODE) === 'development' &&
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
import { getStrings } from '../../core/i18n/getStrings';
|
||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
const MODE = assertSecret(import.meta.env.MODE);
|
||||
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||
const strings = getStrings(Astro.params.locale);
|
||||
|
||||
Reference in new issue
Block a user