Skip to content

Commit 0ba1dde

Browse files
committed
Initial commit
0 parents  commit 0ba1dde

9 files changed

Lines changed: 242 additions & 0 deletions

File tree

.github/workflows/graphs/build.act

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
entry: gh-start
2+
nodes:
3+
- id: gh-start
4+
type: core/gh-start@v1
5+
position:
6+
x: -150
7+
y: 20
8+
- id: checkout
9+
type: github.com/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
10+
position:
11+
x: 270
12+
y: 660
13+
- id: setup-node
14+
type: github.com/actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
15+
position:
16+
x: 810
17+
y: 610
18+
inputs:
19+
node-version: '22'
20+
- id: build
21+
type: core/run@v1
22+
position:
23+
x: 1290
24+
y: 540
25+
inputs:
26+
script: npm install && npm run build
27+
- id: upload-artifact
28+
type: >-
29+
github.com/actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
30+
position:
31+
x: 1720
32+
y: 460
33+
inputs:
34+
name: hello-world
35+
path: out/
36+
- id: print
37+
type: core/print@v1
38+
position:
39+
x: 2600
40+
y: 420
41+
inputs:
42+
values[0]: null
43+
color: fg_green
44+
- id: string-fmt
45+
type: core/string-fmt@v1
46+
position:
47+
x: 2200
48+
y: 620
49+
inputs:
50+
substitutes[0]: null
51+
fmt: 👉 %v
52+
connections:
53+
- src:
54+
node: upload-artifact
55+
port: artifact-url
56+
dst:
57+
node: string-fmt
58+
port: substitutes[0]
59+
- src:
60+
node: string-fmt
61+
port: result
62+
dst:
63+
node: print
64+
port: values[0]
65+
executions:
66+
- src:
67+
node: gh-start
68+
port: exec-on_push
69+
dst:
70+
node: checkout
71+
port: exec
72+
- src:
73+
node: gh-start
74+
port: exec-on_pull_request
75+
dst:
76+
node: checkout
77+
port: exec
78+
- src:
79+
node: gh-start
80+
port: exec-on_workflow_dispatch
81+
dst:
82+
node: checkout
83+
port: exec
84+
- src:
85+
node: checkout
86+
port: exec-success
87+
dst:
88+
node: setup-node
89+
port: exec
90+
- src:
91+
node: setup-node
92+
port: exec-success
93+
dst:
94+
node: build
95+
port: exec
96+
- src:
97+
node: build
98+
port: exec-success
99+
dst:
100+
node: upload-artifact
101+
port: exec
102+
- src:
103+
node: upload-artifact
104+
port: exec-success
105+
dst:
106+
node: print
107+
port: exec

.github/workflows/workflow.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
pull_request:
7+
branches:
8+
- main
9+
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
name: Build Next.js App
16+
steps:
17+
- name: Run Graph
18+
uses: actionforge/action@866e7df1ce5e84a2b32fda7414812ae72000dae8 # v0.14.6
19+
with:
20+
graph-file: build.act

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# dependencies
2+
/node_modules
3+
4+
# next.js
5+
/.next/
6+
/out/
7+
8+
# misc
9+
.DS_Store
10+
11+
# typescript
12+
*.tsbuildinfo
13+
next-env.d.ts

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# example-nextjs
2+
3+
[![view-action-graph](https://img.shields.io/github/actions/workflow/status/actionforge/example-nextjs/workflow.yml?label=View%20Action%20Graph)](https://app.actionforge.dev/github/actionforge/example-nextjs/main/.github/workflows/graphs/build.act)
4+
5+
A simple Hello World app in Next.js, built using an [Actionforge](https://actionforge.dev) graph as the CI/CD pipeline.
6+
7+
## Run
8+
9+
```bash
10+
npm install
11+
npm run dev
12+
```
13+
14+
## Graph
15+
16+
The build pipeline is defined as an Actionforge graph in [`.github/workflows/graphs/build.act`](.github/workflows/graphs/build.act):
17+
18+
```
19+
checkout -> run (npm install && npm run build) -> upload-artifact (out/)
20+
```
21+
22+
It runs on every push to `main`, on pull requests, and on manual dispatch.

app/layout.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export const metadata = {
2+
title: "Hello World",
3+
};
4+
5+
export default function RootLayout({
6+
children,
7+
}: Readonly<{
8+
children: React.ReactNode;
9+
}>) {
10+
return (
11+
<html lang="en">
12+
<body>{children}</body>
13+
</html>
14+
);
15+
}

app/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function Home() {
2+
return <h1>Hello, World!</h1>;
3+
}

next.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
output: "export",
5+
};
6+
7+
export default nextConfig;

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "hello-world",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start"
9+
},
10+
"dependencies": {
11+
"next": "16.1.6",
12+
"react": "19.2.3",
13+
"react-dom": "19.2.3"
14+
},
15+
"devDependencies": {
16+
"@types/node": "^20",
17+
"@types/react": "^19",
18+
"@types/react-dom": "^19",
19+
"typescript": "^5"
20+
}
21+
}

tsconfig.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2017",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"strict": true,
8+
"noEmit": true,
9+
"esModuleInterop": true,
10+
"module": "esnext",
11+
"moduleResolution": "bundler",
12+
"resolveJsonModule": true,
13+
"isolatedModules": true,
14+
"jsx": "react-jsx",
15+
"incremental": true,
16+
"plugins": [
17+
{
18+
"name": "next"
19+
}
20+
],
21+
"paths": {
22+
"@/*": ["./*"]
23+
}
24+
},
25+
"include": [
26+
"next-env.d.ts",
27+
"**/*.ts",
28+
"**/*.tsx",
29+
".next/types/**/*.ts",
30+
".next/dev/types/**/*.ts",
31+
"**/*.mts"
32+
],
33+
"exclude": ["node_modules"]
34+
}

0 commit comments

Comments
 (0)