Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
525142d
testing preview
TharinduX Oct 1, 2023
25ba3fe
test
TharinduX Oct 1, 2023
1d58ab5
fixes
TharinduX Oct 1, 2023
1740bf5
check
TharinduX Oct 1, 2023
a0c7de0
build
TharinduX Oct 1, 2023
4e29e20
changes
TharinduX Oct 1, 2023
e0d020a
changes2
TharinduX Oct 1, 2023
8110a40
url fix
TharinduX Oct 1, 2023
29d9466
changes
TharinduX Oct 1, 2023
7d7ab49
final
TharinduX Oct 1, 2023
75cf2fb
added cache
TharinduX Oct 1, 2023
81b04c7
test
TharinduX Oct 1, 2023
f05b912
node fix
TharinduX Oct 1, 2023
1ccd545
check
TharinduX Oct 1, 2023
6584990
check
TharinduX Oct 1, 2023
23e6ee5
check
TharinduX Oct 1, 2023
a2cbb9d
change
TharinduX Oct 1, 2023
52c95ef
changes final
TharinduX Oct 1, 2023
ea8a9e3
changes
TharinduX Oct 1, 2023
8e281fa
changes
TharinduX Oct 1, 2023
f252002
changes
TharinduX Oct 1, 2023
1699c3c
changes
TharinduX Oct 1, 2023
f1a6252
changes
TharinduX Oct 1, 2023
09b2c92
changes
TharinduX Oct 1, 2023
bd3d6e3
changes
TharinduX Oct 1, 2023
e584a17
changes
TharinduX Oct 1, 2023
99f4126
remove timeout
TharinduX Oct 1, 2023
7e43349
final
TharinduX Oct 1, 2023
1d1568b
conffg changes
TharinduX Oct 1, 2023
94e8e7a
check
TharinduX Oct 1, 2023
de6892b
check
TharinduX Oct 1, 2023
187681e
testing
TharinduX Oct 1, 2023
a556550
changes
TharinduX Oct 1, 2023
0925690
changes
TharinduX Oct 1, 2023
f4b62e1
check this out
TharinduX Oct 1, 2023
f37f619
changes
TharinduX Oct 1, 2023
4a21bde
check this
TharinduX Oct 1, 2023
60967c0
chec
TharinduX Oct 1, 2023
687dd44
check
TharinduX Oct 1, 2023
04f9c1a
lets see
TharinduX Oct 1, 2023
349d035
final
TharinduX Oct 1, 2023
f4d8973
changes
TharinduX Oct 1, 2023
305efb9
check
TharinduX Oct 1, 2023
5c4455a
changes
TharinduX Oct 1, 2023
32a07df
check
TharinduX Oct 1, 2023
0c6250d
asdaw
TharinduX Oct 1, 2023
e984f44
changes
TharinduX Oct 1, 2023
a5a5043
changes
TharinduX Oct 2, 2023
3ddd4c8
changes
TharinduX Oct 2, 2023
4fde8d8
changes
TharinduX Oct 2, 2023
9eca146
final
TharinduX Oct 2, 2023
0b884b2
changes
TharinduX Oct 2, 2023
3af5ff2
changes
TharinduX Oct 2, 2023
132690c
update
TharinduX Oct 2, 2023
729f2e6
changes
TharinduX Oct 2, 2023
7e4fe3b
check
TharinduX Oct 2, 2023
f798457
check
TharinduX Oct 2, 2023
a0b6df0
check this out
TharinduX Oct 2, 2023
ca1668c
check
TharinduX Oct 2, 2023
9e67152
check
TharinduX Oct 2, 2023
4827210
lets check
TharinduX Oct 2, 2023
902ee75
chekc
TharinduX Oct 2, 2023
87cb4f5
check
TharinduX Oct 2, 2023
b567db0
lets check
TharinduX Oct 2, 2023
101e264
check
TharinduX Oct 2, 2023
4ff0279
fix: PR deploy preview
TharinduX Oct 2, 2023
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
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:

- name: Build and Deploy to Netlify
run: |
npm run build
netlify deploy --prod --build

env:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Branch Preview Comment

on:
pull_request:
types:
- opened
push:
branches:
- '*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
- uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
**/package-lock.json
- name: Install dependencies
run: npm install
- name: Build & Deploy to Netlify
id: netlify_deploy
run: |
NETLIFY_AUTH_TOKEN="${{ secrets.NETLIFY_AUTH_TOKEN }}"
NETLIFY_SITE_ID="${{ secrets.NETLIFY_PREVIEW_SITE_ID }}"
PR_NUMBER="${{ github.event.number }}"

# Run the Netlify deploy command
DEPLOY_OUTPUT=$(netlify deploy --build --context deploy-preview --alias "pr-review-${PR_NUMBER}" --json)

# Extract the URLs from the JSON output using jq
DEPLOY_URL=$(echo "$DEPLOY_OUTPUT" | jq -r '.deploy_url')
LOGS_URL=$(echo "$DEPLOY_OUTPUT" | jq -r '.logs')

# Set outputs for later use
echo "::set-output name=deploy_url::${DEPLOY_URL}"
echo "::set-output name=logs_url::${LOGS_URL}"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_PREVIEW_SITE_ID }}
- name: Comment on PR
uses: mshick/add-pr-comment@v2
with:
message: |
This pull request is being automatically deployed to Netlify.

✅ Preview: ${{ steps.netlify_deploy.outputs.deploy_url }}
🔖 Deployed version: ${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build]
command = "npm run build"
publish = ".next"
publish = "build"

[[plugins]]
package = "@netlify/plugin-nextjs"
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const nextConfig = {
experimental: {
appDir: true,
},
distDir: 'build',
};

module.exports = nextConfig;
3 changes: 1 addition & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export default function Home() {
return <div>Hello World!</div>;
return <div>Hello World! Lets build something great!</div>;
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
".next/types/**/*.ts",
"build/types/**/*.ts"
],
"exclude": [
"node_modules"
Expand Down