diff --git a/.github/workflows/cd-app-prod.yaml b/.github/workflows/cd-app-prod.yaml new file mode 100644 index 000000000..cb6b78eb3 --- /dev/null +++ b/.github/workflows/cd-app-prod.yaml @@ -0,0 +1,43 @@ +name: CD - Production + +on: + push: + branches: + - next + +jobs: + publish-app-prod: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish app to production + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - run: corepack enable + - uses: actions/setup-node@v4 + with: + node-version: 22 + corepack: true + cache: 'pnpm' + + - name: Install dependencies + run: pnpm i + + - name: Build the app + run: pnpm -F @it-tools/app build + + - name: Publish to Cloudflare Pages + uses: AdrianGonz97/refined-cf-pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + githubToken: ${{ secrets.GITHUB_TOKEN }} + projectName: it-tools + workingDirectory: packages/app + directory: dist + deploymentName: Production App + branch: next + wranglerVersion: '3' + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 000000000..0d430986a --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# IT-Tools diff --git a/packages/app/src/modules/tools/pages/tool.page.tsx b/packages/app/src/modules/tools/pages/tool.page.tsx index 5a2287bac..d8c693b81 100644 --- a/packages/app/src/modules/tools/pages/tool.page.tsx +++ b/packages/app/src/modules/tools/pages/tool.page.tsx @@ -18,15 +18,23 @@ export const ToolPage: Component = () => { const ToolComponent = lazy(toolDefinition.entryFile); const [toolDict] = createResource(getLocale, async (locale) => { - const [dict = { default: {} }] = await safely(import(`../definitions/${toolDefinition.dirName}/locales/${locale}.json`)); + const [dict, error] = await safely(import(`../definitions/${toolDefinition.dirName}/locales/${locale}.json`)); - return dict; + if (error) { + console.error(error); + } + + return dict ?? { default: {} }; }); return ( - + {toolLocaleDict => ( + {JSON.stringify(toolDefinition)} + )}