forked from aws-samples/amazon-qldb-kvs-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (64 loc) · 1.75 KB
/
nodeapp.yaml
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
name: Node.js Application
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
matrix:
os: [ ubuntu-latest ]
node-version: [ 16 ]
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.IAM_ROLE_TO_ASSUME }}
role-session-name: GitHub
aws-region: us-east-1
- uses: actions/checkout@v3
with:
fetch-depth: '1'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Build & Lint
run: npm run build
- name: Test
run: |
npm test
env:
AWS_REGION: us-east-1
npm-publish:
name: npm-publish
needs: build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: '1'
- name: Publish if version has been updated
uses: pascalgn/[email protected]
with:
tag_name: "v%s"
tag_message: "v%s"
create_tag: "true"
commit_pattern: "^Release (\\S+)"
workspace: "."
publish_command: "yarn"
publish_args: "--non-interactive"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}