File tree 11 files changed +1730
-2
lines changed
11 files changed +1730
-2
lines changed Original file line number Diff line number Diff line change
1
+ needs_fr :
2
+ - ' **' # index.php | src/main.php
3
+ - ' .*' # .gitignore
4
+ - ' .*/**' # .github/workflows/label.yml
Original file line number Diff line number Diff line change
1
+ name : Caching with npm
2
+
3
+ on : workflow_dispatch
4
+
5
+ jobs :
6
+ build :
7
+ runs-on : ubuntu-latest
8
+
9
+ steps :
10
+ - uses : actions/checkout@v3
11
+
12
+ - name : Cache node modules
13
+ id : cache-npm
14
+ uses : actions/cache@v3
15
+ env :
16
+ cache-name : cache-node-modules
17
+ with :
18
+ # npm cache files are stored in `~/.npm` on Linux/macOS
19
+ path : ~/.npm
20
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
21
+ restore-keys : |
22
+ ${{ runner.os }}-build-${{ env.cache-name }}-
23
+ ${{ runner.os }}-build-
24
+ ${{ runner.os }}-
25
+
26
+ - if : ${{ steps.cache-npm.outputs.cache-hit == false }}
27
+ name : List the state of node modules
28
+ continue-on-error : true
29
+ run : npm list
30
+
31
+ - name : Install Dependencies
32
+ run : npm install
33
+
34
+ - name : Build
35
+ run : echo npm build
36
+
37
+ - name : Test
38
+ run : npm test
Original file line number Diff line number Diff line change
1
+ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
+
4
+ name : Node.js CI
5
+
6
+ on :
7
+ push :
8
+ branches : [ main ]
9
+ pull_request :
10
+ branches : [ main ]
11
+
12
+ jobs :
13
+ build :
14
+ strategy :
15
+ matrix :
16
+ os : [ubuntu-latest]
17
+ node-version : [16.x, 18.x]
18
+
19
+ name : Build using ${{ matrix.node-version }} on ${{ matrix.os }}
20
+ runs-on : ${{ matrix.os }}
21
+
22
+ steps :
23
+ - uses : actions/checkout@v2
24
+ - name : Use Node.js ${{ matrix.node-version }}
25
+ uses : actions/setup-node@v1
26
+ with :
27
+ node-version : ${{ matrix.node-version }}
28
+ - run : npm ci
29
+ - run : npm run build --if-present
30
+ - run : npm test
31
+
32
+ label_pr :
33
+ name : Label pull request for review
34
+ if : github.event_name == 'pull_request'
35
+ runs-on : ubuntu-latest
36
+ steps :
37
+ - uses : actions/labeler@main
38
+ with :
39
+ repo-token : " ${{ secrets.GITHUB_TOKEN }}"
Original file line number Diff line number Diff line change
1
+ name : Node.js Package
2
+ on :
3
+ release :
4
+ types : [created]
5
+ jobs :
6
+ build :
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - uses : actions/checkout@v2
10
+ # Setup .npmrc file to publish to npm
11
+ - uses : actions/setup-node@v2
12
+ with :
13
+ node-version : ' 10.x'
14
+ registry-url : ' https://registry.npmjs.org'
15
+ - run : npm install
16
+ # Publish to npm
17
+ - run : npm publish --access public
18
+ env :
19
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
20
+ # Setup .npmrc file to publish to GitHub Packages
21
+ - uses : actions/setup-node@v2
22
+ with :
23
+ registry-url : ' https://npm.pkg.github.com'
24
+ # Publish to GitHub Packages
25
+ - run : npm publish
26
+ env :
27
+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1
- # onboarding-actions
2
- This repository is used in the Docs team onboarding course for Actions.
1
+ # node-hello2
2
+ Everything is awesome node demo 🎉
3
+
4
+ Make a change, for a test.
Original file line number Diff line number Diff line change
1
+ const http = require ( 'http' ) ;
2
+ const express = require ( 'express' ) ;
3
+
4
+ const hostname = '127.0.0.1' ;
5
+ const port = 3000 ;
6
+
7
+ var app = express ( ) ;
8
+ app . use ( express . static ( __dirname + '/public' ) ) ;
9
+
10
+ app . listen ( port , hostname , ( ) => {
11
+ console . log ( `Server running at http://${ hostname } :${ port } /` ) ;
12
+ } ) ;
You can’t perform that action at this time.
0 commit comments