diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..a29aa89 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,23 @@ +name: Deploy + +on: + push: + branches: [main] + +jobs: + deploy: + name: Deploy app + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v1 + with: + node-version: 20.x + - run: npm ci + working-directory: web-app + - run: npm run build + working-directory: web-app + - uses: actions/upload-pages-artifact + with: + path: web-app/build/client + - uses: actions/deploy-pages diff --git a/web-app/.github/workflows/deploy.yml b/web-app/.github/workflows/deploy.yml deleted file mode 100644 index 263b643..0000000 --- a/web-app/.github/workflows/deploy.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Deploy - -on: - push: - branches: [main] - -jobs: - deploy: - name: Deploy app - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: superfly/flyctl-actions/setup-flyctl@master - - run: flyctl deploy --remote-only --config ./fly.toml - env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/web-app/app/root.tsx b/web-app/app/root.tsx index 746cf5a..148136d 100644 --- a/web-app/app/root.tsx +++ b/web-app/app/root.tsx @@ -1,38 +1,9 @@ -import { json, type LinksFunction, type MetaFunction } from '@remix-run/node' -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, - useLoaderData, -} from '@remix-run/react' +import { type LinksFunction, type MetaFunction } from '@remix-run/node' +import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from '@remix-run/react' import type { PropsWithChildren } from 'react' import './font.css' import './tailwind.css' -type ENV = { - ENV: string - BUILD_VERSION: string -} - -declare global { - var ENV: ENV - interface Window { - ENV: ENV - } -} - -export function loader() { - return json({ - ENV: { - ENV: process.env.ENV, - BUILD_VERSION: process.env.BUILD_VERSION, - }, - }) -} - export const meta: MetaFunction = () => { return [{ title: 'Macrolev' }] } @@ -77,16 +48,9 @@ function Document({ children }: DocumentProps) { } export default function App() { - const { ENV } = useLoaderData() - return ( -