-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (49 loc) · 1.81 KB
/
cd.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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Deploy (With Functional Tests)
on:
release:
types:
- released
push:
tags:
- 'v*.*.*'
env:
B2_BUCKET_NAME: ${{ secrets.B2_BUCKET_NAME }}
B2_BUCKET_ID: ${{ secrets.B2_BUCKET_ID }}
B2_APP_KEY: ${{ secrets.B2_APP_KEY }}
B2_APP_KEY_ID: ${{ secrets.B2_APP_KEY_ID }}
B2_APP_KEY_NAME: ${{ secrets.B2_APP_KEY_NAME }}
B2_APP_KEY_PREFIX: ${{ secrets.B2_APP_KEY_PREFIX }}
OLD_B2_APP_KEY: ${{ secrets.OLD_B2_APP_KEY }}
OLD_B2_APP_KEY_ID: ${{ secrets.OLD_B2_APP_KEY_ID }}
OLD_B2_APP_KEY_NAME: ${{ secrets.OLD_B2_APP_KEY_NAME }}
OLD_B2_APP_KEY_PREFIX: ${{ secrets.OLD_B2_APP_KEY_PREFIX }}
jobs:
publish-package:
name: 'Test and Deploy to GH Packages'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.15.4]
steps:
- name: Deploy
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://npm.pkg.github.com/
scope: '@ks-labs'
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
- run: npm install --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{secrets.PACKAGES_TOKEN}}
# rebuild will run the scripts skipped
- run: npm rebuild && npm run prepare --if-present
- run: npm test
- run: echo "@ks-labs:registry=https://npm.pkg.github.com/" >> .npmrc
- run: npm publish $(ls *.tgz)
env:
NODE_AUTH_TOKEN: ${{secrets.PACKAGES_TOKEN}}