utils/.github/workflows/build.yaml

61 lines
1.5 KiB
YAML
Raw Normal View History

2024-02-07 01:33:07 -05:00
name: Build
run-name: Build
on:
- push
- pull_request
jobs:
build:
name: Build NPM Project
runs-on: ubuntu-latest
2024-07-19 00:09:40 -04:00
container: node:20-alpine
2024-02-07 01:33:07 -05:00
steps:
- name: Clone Repository
uses: ztimson/actions/clone@develop
2024-07-19 00:08:39 -04:00
- name: Install & Build
2024-07-19 00:06:17 -04:00
run: |
2024-07-19 00:08:39 -04:00
npm i
2024-07-19 00:06:17 -04:00
npm run build
2024-02-28 23:57:20 -05:00
2024-02-07 01:33:07 -05:00
- name: Test
run: npm run test:coverage
2024-06-16 08:36:45 -04:00
- name: Upload to Registry
uses: ztimson/actions/npm/publish@develop
- name: Upload to NPM
uses: ztimson/actions/npm/publish@develop
2024-02-07 01:33:07 -05:00
with:
2024-06-16 08:36:45 -04:00
owner: ztimson
registry: https://registry.npmjs.org/
token: ${{secrets.NPM_TOKEN}}
2024-02-07 01:33:07 -05:00
tag:
name: Tag Version
needs: build
if: ${{github.ref_name}} == 'release'
runs-on: ubuntu-latest
container: node
steps:
- name: Clone Repository
uses: ztimson/actions/clone@develop
- name: Get Version Number
run: echo "VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+')" >> $GITHUB_ENV
- name: Tag Version
uses: ztimson/actions/tag@develop
with:
tag: ${{env.VERSION}}
2024-10-01 15:08:52 -04:00
docs:
name: Publish Documentation
needs: build
2024-10-01 15:22:48 -04:00
uses: ztimson/actions/.github/workflows/docker.yaml@develop
with:
name: ztimson/utils
repository: ${{github.server_url}}/${{github.repository}}.git
pass: ${{secrets.DEPLOY_TOKEN}}