-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (54 loc) · 1.59 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
name: publish
on: { push: { branches: [master] } }
jobs:
detect-publish:
runs-on: ubuntu-latest
outputs:
publish: ${{ steps.detect-publish.outputs.publish }}
steps:
- uses: actions/checkout@v2
- id: detect-publish
run: |
result=$(./scripts/detect_publish.sh)
echo $result
echo ::set-output name=publish::$result
publish:
runs-on: ubuntu-latest
needs: [detect-publish]
if: needs.detect-publish.outputs.publish == 1
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18.x
registry-url: https://registry.npmjs.org
scope: '@vertexvis'
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
run: |
yarn install --frozen-lockfile
./scripts/publish.sh
docs:
runs-on: ubuntu-latest
needs: [publish]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18.x
registry-url: https://registry.npmjs.org
scope: '@vertexvis'
- name: Deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn install --frozen-lockfile
yarn generate:docs
git config user.name github-actions
git config user.email [email protected]
git add docs/
git commit -m "New docs"
git push -f origin HEAD:gh-pages