-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 1.75 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
name: Publish package
on:
workflow_dispatch:
inputs:
versionType:
description: 'The semantic version segment to increment'
required: true
default: feature
type: choice
options:
- major
- feature
- bug
jobs:
publish-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci
- run: npm run package
- name: Get version
id: get-version
run: |
CURRENT_VERSION=$(npm view @ministryofjustice/hmpps-digital-prison-reporting-frontend version)
echo "Current version: $CURRENT_VERSION"
echo "current_version=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
- name: Bump version
id: bump-version
uses: christian-draeger/increment-semantic-version@1.1.0
with:
current-version: ${{ steps.get-version.outputs.current_version }}
version-fragment: ${{ inputs.versionType }}
- name: Set version
run: sed -i -e 's/Version set by script/${{ steps.bump-version.outputs.next-version }}/' package/package.json
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}
package: package/package.json
publish-pages:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci
- run: npm run docs
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: package/dpr/
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2