ci: update github's workflow

This commit is contained in:
Walid 2022-05-16 13:15:29 +01:00
parent 5b6f5238c2
commit 50d732f4cf
No known key found for this signature in database
GPG Key ID: 7DF9215FC4E48853
4 changed files with 86 additions and 7 deletions

View File

@ -1,7 +0,0 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"

26
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Build tests
on:
push:
branches: [develop]
pull_request:
branches: [main, develop]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.0.0
- name: Use Node.js
uses: actions/setup-node@v3.1.1
with:
node-version: 16.x
- name: Install packages
run: npm ci
- name: Build project
run: npm run build

32
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: 'Lint tests'
on:
push:
branches: [develop]
pull_request:
branches: [main, develop]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.0.0
- name: Use Node.js
uses: actions/setup-node@v3.1.1
with:
node-version: 16.x
- name: Install packages
run: npm ci
- name: Next.js linting
run: npm run lint:next
- name: Prettier linting
run: npm run lint:prettier
- name: Stylelint linting
run: npm run lint:scss

28
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: 'Release version'
on:
push:
branches: [main]
jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
needs: [quality]
steps:
- name: Checkout code
uses: actions/checkout@v3.0.0
- name: Use Node.js
uses: actions/setup-node@v3.1.1
with:
node-version: 16.x
- name: Install packages
run: npm ci
- name: Release project
run: npm run release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}