Skip to content

Commit c43b8c7

Browse files
authored
(CI): pipeline refactoring (#307) (#308)
1 parent 4cf6d7a commit c43b8c7

13 files changed

+161
-193
lines changed

.github/workflows/CD.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/CI.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/documentation.yml renamed to .github/workflows/cd-documentation.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
1-
name: documentation
1+
name: CD - Documentation
22

33
on:
4-
pull_request:
5-
branches: [master]
64
push:
7-
branches: [master]
5+
branches: [ main ]
6+
paths:
7+
- documentation/**/*
88

99
jobs:
10-
checks:
11-
if: github.event_name != 'push'
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v1
15-
- uses: actions/setup-node@v1
16-
with:
17-
node-version: '16.x'
18-
- name: Test Build
19-
run: |
20-
cd documentation
21-
yarn install --frozen-lockfile
22-
rm -rf .docusaurus/
23-
npm run build
24-
gh-release:
25-
if: github.event_name != 'pull_request'
10+
deploy_doc:
2611
runs-on: ubuntu-latest
2712
steps:
2813
- uses: actions/checkout@v1

.github/workflows/cd-npm.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CD workflow to NPM publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
if: "!github.event.release.prerelease"
10+
uses: ./.github/workflows/w-deploy-npm.yml
11+
rc_publish:
12+
if: "!github.event.release.prerelease"
13+
uses: ./.github/workflows/w-deploy-npm.yml
14+
with: ${{ github.event.release.tag_name }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CI - Develop/Next/Main
2+
3+
on:
4+
pull_request:
5+
branches: [ develop, next, main ]
6+
paths:
7+
- template/**/*
8+
9+
jobs:
10+
install_dependencies:
11+
uses: ./.github/workflows/w-install-dependencies.yml
12+
run_linter:
13+
uses: ./.github/workflows/w-run-linters.yml
14+
run_tests:
15+
uses: ./.github/workflows/w-run-tests.yml
16+
# TODO: Add builds and e2e testing phase
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI - Documentation
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
paths:
7+
- documentation/**/*
8+
9+
jobs:
10+
check_build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: '16.x'
17+
- name: Test Build
18+
run: |
19+
cd documentation
20+
yarn install --frozen-lockfile
21+
rm -rf .docusaurus/
22+
npm run build

.github/workflows/ci-feature.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: CI - Feature branche
2+
3+
on:
4+
pull_request:
5+
branches-ignore: [ develop, next, main ]
6+
paths:
7+
- template/**/*
8+
9+
jobs:
10+
install_dependencies:
11+
uses: ./.github/workflows/w-install-dependencies.yml
12+
run_linter:
13+
uses: ./.github/workflows/w-run-linters.yml
14+
run_tests:
15+
uses: ./.github/workflows/w-run-tests.yml

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/w-bump-version.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on: workflow_call
2+
3+
jobs:
4+
bump_version:
5+
name: Bump package.json version
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-node@v1
10+
with:
11+
node-version: 14
12+
- run: |
13+
git config --global user.name "RNB-BotRelease"
14+
git config --global user.email "[email protected]"
15+
npm --no-git-tag-version version ${{ github.event.release.tag_name }}
16+
- name: Commit and push
17+
run: |
18+
git add .
19+
git commit -am "🏷️(version) Update boilerplate to version ${{ github.event.release.tag_name }}"
20+
git push
21+
env:
22+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/w-deploy-npm.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
tag:
5+
default: "latest"
6+
type: string
7+
required: false
8+
secrets:
9+
NPM_TOKEN:
10+
required: true
11+
12+
jobs:
13+
publish_npm:
14+
name: Deploy the version to npm
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v1
19+
with:
20+
node-version: 14
21+
- run: |
22+
git config --global user.name "RNB-BotRelease"
23+
git config --global user.email "[email protected]"
24+
npm --no-git-tag-version version ${{ github.event.release.tag_name }}
25+
- uses: JS-DevTools/npm-publish@v1
26+
with:
27+
token: ${{ secrets.NPM_TOKEN }}
28+
tag: ${{ inputs.tag }}

0 commit comments

Comments
 (0)