Skip to content

Commit

Permalink
updated job for clarity also added one to publish to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
mikalai-snap committed Mar 26, 2024
1 parent 92f155c commit 5e423af
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js CI
name: Build

on:
push:
Expand All @@ -17,7 +17,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to npm

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'

- name: Install dependencies
uses: borales/actions-yarn@v5
with:
cmd: install --immutable

- name: Prepare
uses: borales/actions-yarn@v5
with:
cmd: prepare

- name: Pack
uses: borales/actions-yarn@v5
with:
cmd: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
name: Deploy docs to Pages

on:
# Runs on pushes targeting the default branch
Expand Down Expand Up @@ -50,13 +50,13 @@ jobs:

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './docs'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 5e423af

Please sign in to comment.