Skip to content
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ on:
push:
branches: ["prod"]

# Runs after the Release workflow completes successfully
workflow_run:
workflows: ["Release"]
types:
- completed
branches: [dev]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -27,9 +34,14 @@ concurrency:
jobs:
lint:
runs-on: ubuntu-latest
# Only run if workflow was triggered by push/workflow_dispatch, or if workflow_run concluded successfully
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# Checkout prod branch when triggered by workflow_run, otherwise use default
ref: ${{ github.event_name == 'workflow_run' && 'prod' || github.ref }}
- name: Setup Node
uses: actions/setup-node@v6
with:
Expand All @@ -43,9 +55,14 @@ jobs:
build:
runs-on: ubuntu-latest
needs: lint
# Only run if workflow was triggered by push/workflow_dispatch, or if workflow_run concluded successfully
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# Checkout prod branch when triggered by workflow_run, otherwise use default
ref: ${{ github.event_name == 'workflow_run' && 'prod' || github.ref }}
- name: Detect package manager
id: detect-package-manager
run: |
Expand Down
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,32 @@ npm run dev

## 📦 Build & Deploy

Build for production:
### Production Build (for GitHub Pages)

Build for production deployment:

```bash
npm run build
```

The app is automatically deployed to GitHub Pages on every push to the `main` branch.
This creates an optimized static export in the `out` directory with the `/geo-invaders` base path configured for GitHub Pages.

### Local Testing Build

To build and test the production build locally:

```bash
npm run build:local
npm run start
```

The `build:local` script creates a build without the GitHub Pages base path, making it suitable for local testing at `http://localhost:3000`.

**Note:** Don't use `npm run build` followed by `npm run start` for local testing, as the production build includes the `/geo-invaders` base path and won't work correctly on localhost.

### Deployment

The app is automatically deployed to GitHub Pages on every push to the `prod` branch.

## 🤝 Contributing

Expand Down
Loading