Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
15 changes: 7 additions & 8 deletions .github/workflows/open-ai-app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & deploy Next.js app to Azure Web App
name: Build & Deploy Netchex ChatGPT

# When this action will be executed
on:
Expand All @@ -21,6 +21,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
cache-dependency-path: "./src/package-lock.json"

- name: ⚙️ npm install and build
run: |
Expand All @@ -38,16 +40,13 @@ jobs:
- name: 📂 Copy Public folder
run: cp -R ./src/public ./site-deploy/public

- name: 📂 Copy App Insights script
run: cp -R ./src/appInsights.js ./site-deploy/appInsights.js

- name: 📦 Package Next application
run: |
cd ./site-deploy
zip Nextjs-site.zip ./* .next -qr

- name: 🔍 Diagnostics
run: |
ls ./src
ls ./src/.next
ls ./site-deploy
zip Nextjs-site.zip ./* .next -qr

- name: ⬆️ Publish Next Application artifact
uses: actions/upload-artifact@v3
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

infra/*.parameters.json
infra/*.parameters.json*
site-deploy/

# Exclude all files under .scratchpad but leave the folder itself
.[Ss]cratch[Pp]ad/*
!.[Ss]cratch[Pp]ad/.gitkeep
60 changes: 31 additions & 29 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"cwd": "${workspaceFolder}/src",
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"cwd": "${workspaceFolder}/src",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"cwd": "${workspaceFolder}/src",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"cwd": "${workspaceFolder}/src",
"command": "npm run dev",
"envFile": "${workspaceFolder}/src/.env.local",
},
{
"name": "Next.js: debug client-side",
"type": "msedge",
"request": "launch",
"cwd": "${workspaceFolder}/src",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"cwd": "${workspaceFolder}/src",
"command": "npm run dev",
"envFile": "${workspaceFolder}/src/.env.local",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
"action": "debugWithEdge"
}
]
}
}
]
}
36 changes: 24 additions & 12 deletions infra/main.bicep
Original file line number Diff line number Diff line change
@@ -1,39 +1,51 @@
@description('Name of the the environment which is used to generate a short unique hash used in all resources.')
@minLength(1)
@maxLength(64)
@description('Name of the the environment which is used to generate a short unique hash used in all resources.')
param name string

@description('Optional. The location to which the resources are deployed.')
param location string = resourceGroup().location

@description('Azure OpenAI API Key')
@minLength(1)
@maxLength(64)
@description('Azure OpenAI API Key')
param openaiApiKey string

@description('Azure OpenAI Instance Name e.g. my-openai-instance')
@minLength(1)
@maxLength(64)
@description('Azure OpenAI Instance Name e.g. my-openai-instance')
param openaiInstanceName string

@description('Azure OpenAI Deployment Name e.g. gpt3-turbo')
@minLength(1)
@maxLength(64)
@description('Azure OpenAI Deployment Name e.g. gpt3-turbo')
param openaiDeploymentName string

@description('Azure OpenAI API Version e.g. 2021-08-04-preview')
@minLength(1)
@maxLength(64)
@description('Azure OpenAI API Version e.g. 2021-08-04-preview')
param openaiApiVersion string

var resourceToken = toLower(uniqueString(subscription().id, name, resourceGroup().location))
param azureAdTenantId string

@secure()
param azureAdClientSecret string

param azureAdClientId string

var resourceToken = toLower(uniqueString(subscription().id, name, location))

module resources 'resources.bicep' = {
module nested_resources './resources.bicep' = {
name: 'resources-${resourceToken}'
params: {
name: name
resourceToken: resourceToken
openai_api_key: openaiApiKey
openai_instance_name: openaiInstanceName
openai_deployment_name: openaiDeploymentName
openai_api_version: openaiApiVersion
location: location
openaiApiKey: openaiApiKey
openaiName: openaiInstanceName
openaiDeploymentName: openaiDeploymentName
openaiApiVersion: openaiApiVersion
azureAdTenantId: azureAdTenantId
azureAdClientSecret: azureAdClientSecret
azureAdClientId: azureAdClientId
}
}
210 changes: 0 additions & 210 deletions infra/main.json

This file was deleted.

Loading