generated from allen-cell-animated/github-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (88 loc) · 3.09 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: NPM Package
env:
NODE_VERSION: "18"
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Setup Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: ${{env.NODE_VERSION}}
- run: npm ci
- run: npm run lint --if-present
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Setup Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: ${{env.NODE_VERSION}}
- run: npm ci
- run: npm test --if-present
typeCheck:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Setup Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: ${{env.NODE_VERSION}}
- run: npm ci
- run: npm run typeCheck --if-present
build:
needs: [lint, typeCheck, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: ${{env.NODE_VERSION}}
- run: npm ci
- run: npm run build
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: ${{env.NODE_VERSION}}
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
deploy:
needs: publish-npm
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: ${{env.NODE_VERSION}}
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run gh-build-release
- name: Deploy
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847
with:
external_repository: allen-cell-animated/website-3d-cell-viewer-release
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./imageviewer
tag_name: deploy-${{ github.ref_name }}
tag_message: "Deployment to website-3d-cell-viewer-release ${{ github.ref_name }}"