Skip to content

Commit 0cc0a08

Browse files
committed
Add ci template files
1 parent 93f622f commit 0cc0a08

File tree

8 files changed

+456
-0
lines changed

8 files changed

+456
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, 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: Docker
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
16+
jobs:
17+
eslint:
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
matrix:
22+
node-version: [16.x, 18.x]
23+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
cache: 'npm'
32+
- run: npm ci
33+
# - run: npm run build --if-present
34+
- run: npm run eslint
35+
build:
36+
needs: eslint
37+
38+
runs-on: ubuntu-latest
39+
permissions:
40+
contents: read
41+
packages: write
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v3
46+
# Login against a Docker registry except on PR
47+
# https://github.com/docker/login-action
48+
- name: Log into registry ${{ env.REGISTRY }}
49+
uses: docker/login-action@v2
50+
with:
51+
registry: ${{ env.REGISTRY }}
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
# Extract metadata (tags, labels) for Docker
56+
# https://github.com/docker/metadata-action
57+
- name: Extract Docker metadata
58+
id: meta
59+
uses: docker/metadata-action@v4
60+
with:
61+
tags: |
62+
type=sha,prefix=sha-
63+
type=ref,event=branch
64+
type=raw,value=latest
65+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
66+
# https://github.com/docker/build-push-action
67+
- name: Build and push Docker image
68+
id: build-and-push
69+
uses: docker/build-push-action@v3
70+
with:
71+
context: .
72+
push: true
73+
tags: ${{ steps.meta.outputs.tags }}
74+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, 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: Docker
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
matrix:
22+
node-version: [16.x, 18.x]
23+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
cache: 'npm'
32+
- run: npm ci
33+
# - run: npm run build --if-present
34+
- run: npm test
35+
eslint:
36+
runs-on: ubuntu-latest
37+
38+
strategy:
39+
matrix:
40+
node-version: [16.x, 18.x]
41+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
42+
43+
steps:
44+
- uses: actions/checkout@v3
45+
- name: Use Node.js ${{ matrix.node-version }}
46+
uses: actions/setup-node@v3
47+
with:
48+
node-version: ${{ matrix.node-version }}
49+
cache: 'npm'
50+
- run: npm ci
51+
# - run: npm run build --if-present
52+
- run: npm run eslint
53+
build:
54+
needs:
55+
- test
56+
- eslint
57+
58+
runs-on: ubuntu-latest
59+
permissions:
60+
contents: read
61+
packages: write
62+
63+
steps:
64+
- name: Checkout repository
65+
uses: actions/checkout@v3
66+
# Login against a Docker registry except on PR
67+
# https://github.com/docker/login-action
68+
- name: Log into registry ${{ env.REGISTRY }}
69+
uses: docker/login-action@v2
70+
with:
71+
registry: ${{ env.REGISTRY }}
72+
username: ${{ github.actor }}
73+
password: ${{ secrets.GITHUB_TOKEN }}
74+
75+
# Extract metadata (tags, labels) for Docker
76+
# https://github.com/docker/metadata-action
77+
- name: Extract Docker metadata
78+
id: meta
79+
uses: docker/metadata-action@v4
80+
with:
81+
tags: |
82+
type=sha,prefix=sha-
83+
type=ref,event=branch
84+
type=raw,value=latest
85+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
86+
# https://github.com/docker/build-push-action
87+
- name: Build and push Docker image
88+
id: build-and-push
89+
uses: docker/build-push-action@v3
90+
with:
91+
context: .
92+
push: true
93+
tags: ${{ steps.meta.outputs.tags }}
94+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, 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: Docker
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v3
26+
# Login against a Docker registry except on PR
27+
# https://github.com/docker/login-action
28+
- name: Log into registry ${{ env.REGISTRY }}
29+
uses: docker/login-action@v2
30+
with:
31+
registry: ${{ env.REGISTRY }}
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
# Extract metadata (tags, labels) for Docker
36+
# https://github.com/docker/metadata-action
37+
- name: Extract Docker metadata
38+
id: meta
39+
uses: docker/metadata-action@v4
40+
with:
41+
tags: |
42+
type=sha,prefix=sha-
43+
type=ref,event=branch
44+
type=raw,value=latest
45+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
46+
# https://github.com/docker/build-push-action
47+
- name: Build and push Docker image
48+
id: build-and-push
49+
uses: docker/build-push-action@v3
50+
with:
51+
context: .
52+
push: true
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, 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: Docker
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
matrix:
22+
node-version: [16.x, 18.x]
23+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
cache: 'npm'
32+
- run: npm ci
33+
# - run: npm run build --if-present
34+
- run: npm test
35+
build:
36+
needs: test
37+
38+
runs-on: ubuntu-latest
39+
permissions:
40+
contents: read
41+
packages: write
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v3
46+
# Login against a Docker registry except on PR
47+
# https://github.com/docker/login-action
48+
- name: Log into registry ${{ env.REGISTRY }}
49+
uses: docker/login-action@v2
50+
with:
51+
registry: ${{ env.REGISTRY }}
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
# Extract metadata (tags, labels) for Docker
56+
# https://github.com/docker/metadata-action
57+
- name: Extract Docker metadata
58+
id: meta
59+
uses: docker/metadata-action@v4
60+
with:
61+
tags: |
62+
type=sha,prefix=sha-
63+
type=ref,event=branch
64+
type=raw,value=latest
65+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
66+
# https://github.com/docker/build-push-action
67+
- name: Build and push Docker image
68+
id: build-and-push
69+
uses: docker/build-push-action@v3
70+
with:
71+
context: .
72+
push: true
73+
tags: ${{ steps.meta.outputs.tags }}
74+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ESLint
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
eslint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
submodules: recursive
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 16
19+
- name: Install modules
20+
run: npm ci
21+
- name: Run ESLint
22+
run: npm run eslint
23+
publish:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
submodules: recursive
29+
- uses: actions/setup-node@v3
30+
with:
31+
node-version: 16
32+
- run: npm ci
33+
- run: npm run build
34+
- run: npm version prerelease --no-git-tag-version --preid ${{ github.ref_name }}-${{ github.sha }}
35+
- uses: JS-DevTools/npm-publish@v1
36+
with:
37+
access: public
38+
token: ${{ secrets.NPM_TOKEN }}
39+
tag: beta
40+
check-version: false
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ESLint
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
eslint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
submodules: recursive
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 16
19+
- name: Install modules
20+
run: npm ci
21+
- name: Run ESLint
22+
run: npm run eslint
23+
test:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
submodules: recursive
29+
- uses: actions/setup-node@v3
30+
with:
31+
node-version: 16
32+
- name: Install modules
33+
run: npm ci
34+
- name: Run Tests
35+
run: npm test
36+
publish:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v3
40+
with:
41+
submodules: recursive
42+
- uses: actions/setup-node@v3
43+
with:
44+
node-version: 16
45+
- run: npm ci
46+
- run: npm run build
47+
- run: npm version prerelease --no-git-tag-version --preid ${{ github.ref_name }}-${{ github.sha }}
48+
- uses: JS-DevTools/npm-publish@v1
49+
with:
50+
access: public
51+
token: ${{ secrets.NPM_TOKEN }}
52+
tag: beta
53+
check-version: false

0 commit comments

Comments
 (0)