mirror of
https://github.com/tenrok/maska.git
synced 2026-05-15 11:59:38 +03:00
74 lines
1.7 KiB
YAML
74 lines
1.7 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
# outputs:
|
|
# coverage: ${{ steps.coverage.outputs.value }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Install
|
|
run: npm ci
|
|
|
|
- name: Test
|
|
run: npm run test
|
|
# run: npm run test:coverage
|
|
|
|
# - name: Parse coverage
|
|
# uses: sergeysova/jq-action@v2
|
|
# id: coverage
|
|
# with:
|
|
# cmd: 'jq .total.statements.pct coverage/coverage-summary.json'
|
|
|
|
- name: Upload demo artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./docs
|
|
|
|
# badge:
|
|
# runs-on: ubuntu-latest
|
|
# needs: build
|
|
|
|
# steps:
|
|
# - name: Create badge
|
|
# uses: schneegans/dynamic-badges-action@v1.6.0
|
|
# with:
|
|
# auth: ${{ secrets.GIST_SECRET }}
|
|
# gistID: 7f2a04de5e494f9a3820832520ee2562
|
|
# filename: badge.json
|
|
# label: Code Coverage
|
|
# message: ${{ needs.build.outputs.coverage }}%
|
|
# valColorRange: ${{ needs.build.outputs.coverage }}
|
|
# maxColorRange: 100
|
|
# minColorRange: 0
|
|
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
|
|
permissions:
|
|
pages: write # to deploy to Pages
|
|
id-token: write # to verify the deployment originates from an appropriate source
|
|
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|