Skip to content

Commit d3b45f7

Browse files
committed
feat: Add deployment workflow and fix linting issues
1 parent 8a3dba8 commit d3b45f7

File tree

5 files changed

+123
-5
lines changed

5 files changed

+123
-5
lines changed

.cursor/rules/robs-rules.mdc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
Always use arrow functions in typescript.
7+
Make sure we can elegantly handle errors, but don't overcomplicate error handling.
8+
NEVER ignore linting rules! fix the problems.
9+
Always look for opportunities to strengthen the linting rules.
10+
Consolidate domain types in one location so we have a strong domain model.
11+
Always try and improve the type checking.
12+
Try and avoid duplication between types.
13+
Use immer where possible to avoid mutation.
14+
Use Zustand to manage state.
15+
Don't add a logging facility, the console is fine.
16+
Code should be as simple and concise as possible.
17+
REMOVE ALL COMMENTS! unless they are really important.
18+
Use blank lines to make code easier to read.
19+
Please ALWAYS! keep the README file up to date.
20+
In addition in the 'docs' folder create additional detailed technical documentation in the form of markdown documents and keep it up to date as you go.
21+
When reviewing a file, should it be broken up? can it be improved? is this functionality in the right location within the project
22+
When I just type 'cp' that means "review all changes in each file, remove comments, run 'npm run check' fix any issues then 'git add -A' and commit and push all changed files."
23+
When I just type 'p' that means "proceed"
24+
Dont give me a list of options to choose, devise the best plan you can and proceed with it.
25+

.github/workflows/deploy.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy to Cloudflare
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
name: Deploy to Cloudflare
16+
permissions:
17+
contents: read
18+
deployments: write
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "20"
27+
28+
- name: Install dependencies
29+
run: npm install
30+
31+
- name: Build Next.js application
32+
run: npx @opennextjs/cloudflare build
33+
34+
- name: Deploy Next.js to Cloudflare Pages
35+
uses: cloudflare/wrangler-action@v3
36+
with:
37+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
38+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
39+
command: pages deploy .open-next --project-name=rgou-cloudflare --branch=main
40+
41+
- name: Setup Rust
42+
uses: dtolnay/rust-toolchain@stable
43+
44+
- name: Deploy AI Worker to Cloudflare Workers
45+
uses: cloudflare/wrangler-action@v3
46+
with:
47+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
48+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
49+
workingDirectory: "worker"
50+
command: deploy

package-lock.json

Lines changed: 44 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@
2727
"clsx": "^2.1.1",
2828
"framer-motion": "^12.18.1",
2929
"lucide-react": "^0.519.0",
30+
"immer": "^10.1.1",
3031
"next": "^15.3.4",
3132
"react": "^19.1.0",
3233
"react-dom": "^19.1.0",
33-
"tailwind-merge": "^3.3.1"
34+
"tailwind-merge": "^3.3.1",
35+
"zustand": "^5.0.5"
3436
},
3537
"devDependencies": {
3638
"@eslint/eslintrc": "^3",

src/components/RoyalGameOfUr.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export default function RoyalGameOfUr() {
173173
if (gameState.currentPlayer === "player2" && gameState.canMove) {
174174
makeAIMove(gameState);
175175
}
176-
}, [gameState.currentPlayer, gameState.canMove, makeAIMove]);
176+
}, [gameState, makeAIMove]);
177177

178178
// Handle game end sound effects
179179
useEffect(() => {

0 commit comments

Comments
 (0)