Skip to content

Update all dependencies #1132

Update all dependencies

Update all dependencies #1132

Workflow file for this run

name: build
on:
pull_request:
push:
branches: [ main ]
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Check package.json is sorted
run: npx sort-package-json --check
- name: Restore npm dependencies cache
id: npm-cache
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-npm-cache-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
- name: Install npm dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: ESLint analysis
run: npm run eslint
- name: Stylelint analysis
run: npm run stylelint
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
flags: unit-tests-${{ matrix.os }}
fail_ci_if_error: true
- name: Upload build artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@master
with:
name: build
path: ./build
deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Restore npm dependencies cache
id: npm-cache
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-npm-cache-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
- name: Install npm dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Download build artifact
uses: actions/download-artifact@master
with:
name: build
path: ./build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./build
release:
needs: deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bump version
id: version
uses: paulhatch/[email protected]
- name: Create GitHub tag and release
uses: softprops/[email protected]
with:
tag_name: ${{ steps.version.outputs.version_tag }}
generate_release_notes: true