Skip to content

Commit dd0a84b

Browse files
committed
Initial commit
0 parents  commit dd0a84b

6 files changed

Lines changed: 110 additions & 0 deletions

File tree

.github/workflows/graphs/build.act

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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: run
21+
type: core/run@v1
22+
position:
23+
x: 1290
24+
y: 540
25+
inputs:
26+
script: node index.js
27+
connections: []
28+
executions:
29+
- src:
30+
node: gh-start
31+
port: exec-on_push
32+
dst:
33+
node: checkout
34+
port: exec
35+
- src:
36+
node: gh-start
37+
port: exec-on_pull_request
38+
dst:
39+
node: checkout
40+
port: exec
41+
- src:
42+
node: gh-start
43+
port: exec-on_workflow_dispatch
44+
dst:
45+
node: checkout
46+
port: exec
47+
- src:
48+
node: checkout
49+
port: exec-success
50+
dst:
51+
node: setup-node
52+
port: exec
53+
- src:
54+
node: setup-node
55+
port: exec-success
56+
dst:
57+
node: run
58+
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: Run Node.js Hello World
16+
steps:
17+
- name: Run Graph
18+
uses: actionforge/action@866e7df1ce5e84a2b32fda7414812ae72000dae8 # v0.14.6
19+
with:
20+
graph-file: build.act

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
.DS_Store

README.md

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

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Hello, World!");

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "hello-world",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"scripts": {
6+
"start": "node index.js"
7+
}
8+
}

0 commit comments

Comments
 (0)