Skip to content

Commit 00b43e1

Browse files
authored
refactor(ci): simplify ci (#409)
1 parent 75fc558 commit 00b43e1

File tree

15 files changed

+136
-143
lines changed

15 files changed

+136
-143
lines changed

.github/actions/deps-setup/action.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Setup
2+
description: Checkout and Install dependencies with cache on the project under template/
3+
inputs:
4+
working_directory:
5+
description: 'The directory where the install command will be run'
6+
required: true
7+
type: string
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Setup Node.js
12+
uses: actions/setup-node@v4
13+
with:
14+
node-version: '20.x'
15+
cache: 'yarn'
16+
cache-dependency-path: ${{ inputs.working_directory }}/yarn.lock
17+
- name: Install dependencies
18+
run: yarn install --frozen-lockfile
19+
shell: bash
20+
working-directory: ${{ inputs.working_directory }}

.github/actions/install-dependencies/action.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Boilerplate => Eslint, Prettier and Jest tests
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
paths:
7+
- template/**/*
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
lint_type_test:
18+
name: Run eslint, prettier, type check and jest tests
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- uses: ./.github/actions/deps-setup
24+
with:
25+
working_directory: ./template
26+
- name: Run Eslint
27+
run: yarn lint
28+
working-directory: ./template
29+
- name: Run Typescript check
30+
run: yarn type-check
31+
working-directory: ./template
32+
- name: Run Jest tests
33+
run: yarn test
34+
working-directory: ./template
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release new boilerplate version
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
if: "!github.event.release.prerelease"
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.event.release.target_commitish }}
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '20.x'
18+
registry-url: 'https://registry.npmjs.org'
19+
- run: npm publish
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.NPM }}
22+
- run: |
23+
git config --global user.name "ReactNativeBoilerplate Bot"
24+
git config --global user.email "[email protected]"
25+
npm --no-git-tag-version version ${{ github.event.release.name }}
26+
- name: Commit and push
27+
run: |
28+
git add .
29+
git commit -am "bump(version): tag boilerplate to version ${{ github.event.release.name }}"
30+
git push
31+
env:
32+
github-token: ${{ secrets.GITHUB }}

.github/workflows/cd-npm.yml

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

.github/workflows/ci-develop-next-main.yml

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

.github/workflows/ci-documentation.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Documentation => EsLint, Typescript check and build
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
paths:
7+
- documentation/**/*
8+
- template/theme/**/*
9+
- template/package.json
10+
- template/yarn.lock
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
lint_type_build:
21+
name: Run eslint, prettier, type check and build tests
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
- uses: ./.github/actions/deps-setup
27+
with:
28+
working_directory: ./documentation
29+
- name: Run Eslint
30+
run: yarn lint
31+
working-directory: ./documentation
32+
- name: Run Typescript check
33+
run: yarn type-check
34+
working-directory: ./documentation
35+
- name: Remove previous build
36+
run: rm -rf .docusaurus/
37+
working-directory: ./documentation
38+
- name: Build documentation
39+
run: yarn build
40+
working-directory: ./documentation

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CD - Documentation
1+
name: Deploy Documentation to GitHub Pages
22

33
on:
44
push:
@@ -12,10 +12,12 @@ jobs:
1212
deploy_doc:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v1
16-
- uses: actions/setup-node@v1
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
1717
with:
18-
node-version: '19.x'
18+
node-version: '20.x'
19+
cache: 'yarn'
20+
cache-dependency-path: ./documentation/yarn.lock
1921
- name: Add key to allow access to repository
2022
env:
2123
SSH_AUTH_SOCK: /tmp/ssh_agent.sock

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

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

0 commit comments

Comments
 (0)