Skip to content

Commit

Permalink
DEV-4: Set up cloud env
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyhu-x committed Feb 21, 2025
1 parent 8337213 commit 5bea51d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
branches: [ "main" ]

env:
AZURE_WEBAPP_NAME: pera
AZURE_WEBAPP_PACKAGE_PATH: './build/standalone'
NODE_VERSION: '22.x'

permissions:
contents: read

jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: npm install, build, and test
run: |
npm install
npm run build
npm run test --if-present
mv ./build/static ./build/standalone/build
mv ./public ./build/standalone
- name: Deploy to Azure App Service
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
3 changes: 2 additions & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
output: "standalone",
distDir: "build",
};

export default nextConfig;
11 changes: 9 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"include": [
"**/*.ts",
"**/*.tsx",
"next-env.d.ts",
"build/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}

0 comments on commit 5bea51d

Please sign in to comment.