Skip to content

Commit 94176fc

Browse files
authored
Merge pull request #1 from HeapDog/dev
fix deploy
2 parents ee85f50 + 8271625 commit 94176fc

File tree

7 files changed

+72
-6
lines changed

7 files changed

+72
-6
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy to Dev VM
2+
3+
on:
4+
push:
5+
branches: ["dev"]
6+
workflow_dispatch: {}
7+
8+
concurrency:
9+
group: deploy-to-vm
10+
cancel-in-progress: true
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repo (optional)
17+
uses: actions/checkout@v4
18+
19+
# Start Tailscale on the runner using the official GitHub Action.
20+
# The action reads the client id / secret from env here (you said you already put them as secrets).
21+
- name: Start Tailscale
22+
uses: tailscale/github-action@v4
23+
with:
24+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
25+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
26+
tags: tag:ci
27+
28+
- name: SSH to VM and deploy
29+
run: |
30+
ssh -o "StrictHostKeyChecking no" ${{ secrets.INSTANCE_USER}}@${{ secrets.DEV_INSTANCE_TS_IP}} "
31+
cd ${{ secrets.PROJECT_PATH }}/frontend
32+
git checkout dev
33+
git fetch origin dev
34+
git reset --hard origin/dev
35+
docker compose -f compose.dev.yml stop frontend-dev
36+
docker compose -f compose.dev.yml rm -f frontend-dev
37+
docker compose -f compose.dev.yml build frontend-dev
38+
docker compose -f compose.dev.yml up -d --force-recreate frontend-dev
39+
docker image prune -af
40+
docker container prune -f
41+
docker system prune -f
42+
"
43+
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to VM via Tailscale
1+
name: Deploy to Prod VM
22

33
on:
44
push:
@@ -27,8 +27,9 @@ jobs:
2727

2828
- name: SSH to VM and deploy
2929
run: |
30-
ssh -o "StrictHostKeyChecking no" ${{ secrets.EC2_USER }}@${{ secrets.EC2_IP }} "
30+
ssh -o "StrictHostKeyChecking no" ${{ secrets.INSTANCE_USER}}@${{ secrets.PROD_INSTANCE_TS_IP}} "
3131
cd ${{ secrets.PROJECT_PATH }}/frontend
32+
git checkout main
3233
git fetch origin main
3334
git reset --hard origin/main
3435
docker compose stop frontend

src/app/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { getCurrentUser } from "@/lib/auth";
1010
import { Toaster } from "@/components/ui/sonner";
1111
import { getNotifications, getUnreadCount } from "@/lib/notifications";
1212

13+
export const dynamic = "force-dynamic";
14+
1315
const geistSans = Geist({
1416
variable: "--font-geist-sans",
1517
subsets: ["latin"],

src/app/organizations/[slug]/members/invitations/page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { OrganizationInvitation } from "@/lib/types/organization";
44
import { PaginatedData } from "@/lib/types/api";
55
import { InvitationsView } from "./invitations-view";
66
import { cookies } from "next/headers";
7+
import { Suspense } from "react";
78

89
async function getInvitations(slug: string, page: number, size: number) {
910
try {
@@ -56,5 +57,9 @@ export default async function InvitationsPage({ params, searchParams }: PageProp
5657

5758
const data = await getInvitations(slug, page, size);
5859

59-
return <InvitationsView organizationSlug={slug} initialData={data} currentUserRole={role} />;
60+
return (
61+
<Suspense fallback={<div>Loading invitations...</div>}>
62+
<InvitationsView organizationSlug={slug} initialData={data} currentUserRole={role} />
63+
</Suspense>
64+
);
6065
}

src/app/organizations/[slug]/members/page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { OrganizationMember } from "@/lib/types/organization";
44
import { PaginatedData } from "@/lib/types/api";
55
import { MembersView } from "./members-view";
66
import { cookies } from "next/headers";
7+
import { Suspense } from "react";
78

89
async function getMembers(slug: string, page: number, size: number) {
910
try {
@@ -61,5 +62,9 @@ export default async function MembersPage({ params, searchParams }: PageProps) {
6162
)
6263
}
6364

64-
return <MembersView data={data} />;
65+
return (
66+
<Suspense fallback={<div>Loading members...</div>}>
67+
<MembersView data={data} />
68+
</Suspense>
69+
);
6570
}

src/app/signin/page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { getCurrentUser } from "@/lib/auth";
22
import { redirect } from "next/navigation";
33
import SigninPage from "./signin-page";
44
import { Metadata } from "next";
5+
import { Suspense } from "react";
56

67
export const metadata: Metadata = {
78
title: "Sign In | HeapDog",
@@ -20,5 +21,9 @@ export default async function Page(props: {
2021
redirect(redirectUrl);
2122
}
2223

23-
return <SigninPage />;
24+
return (
25+
<Suspense fallback={<div>Loading...</div>}>
26+
<SigninPage />
27+
</Suspense>
28+
);
2429
}

src/app/verify/page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { getCurrentUser } from "@/lib/auth";
22
import { redirect } from "next/navigation";
33
import VerifyPage from "./verify-page";
44
import { Metadata } from "next";
5+
import { Suspense } from "react";
56

67
export const metadata: Metadata = {
78
title: "Verify Email | HeapDog",
@@ -15,6 +16,10 @@ export default async function Page() {
1516
redirect("/");
1617
}
1718

18-
return <VerifyPage />;
19+
return (
20+
<Suspense fallback={<div>Loading...</div>}>
21+
<VerifyPage />
22+
</Suspense>
23+
);
1924
}
2025

0 commit comments

Comments
 (0)