Skip to content

Commit

Permalink
build: prepare for cloudflare deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelgautier committed Aug 17, 2024
1 parent 04b75cc commit 4b4fdda
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 388 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
directory: ./dist/angular-spa/browser
- workingDirectory: ./examples/nextjs-app
projectName: cerberauth-nextjs-app-oidc
directory: ./
directory: ./.vercel/output/static

permissions:
contents: read
Expand All @@ -52,7 +52,7 @@ jobs:
run: npm ci

- name: Run build
run: npm run build
run: npm run pages:build

- name: Publish
uses: cloudflare/pages-action@1
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# OpenID Connect Examples / Demo

This repository contains a collection of OpenID Connect examples.
This repository contains a collection of OpenID Connect examples. Check out the examples below to see how to integrate OpenID Connect with your application.

You can use the examples as a starting point for your own project or as a reference to understand how OpenID Connect works.

## Examples

- [Angular SPA](./examples/angular-spa/README.md)
- [Next.js SPA](./examples/nextjs-spa/README.md)
- [React SPA](./examples/react-spa/README.md)

## License
Expand Down
1 change: 1 addition & 0 deletions examples/angular-spa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"pages:build": "ng build --configuration production",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
Expand Down
9 changes: 9 additions & 0 deletions examples/nextjs-app/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev'

// Here we use the @cloudflare/next-on-pages next-dev module to allow us to use bindings during local development
// (when running the application with `next dev`), for more information see:
// https://github.com/cloudflare/next-on-pages/blob/5712c57ea7/internal-packages/next-dev/README.md
if (process.env.NODE_ENV === 'development') {
await setupDevPlatform()
}

/** @type {import('next').NextConfig} */
const nextConfig = {
output: process.env.NEXT_BUILD_OUTPUT,
Expand Down
Loading

0 comments on commit 4b4fdda

Please sign in to comment.