-
Notifications
You must be signed in to change notification settings - Fork 14
40 lines (40 loc) · 1.31 KB
/
main.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
name: workflow
on: [push]
jobs:
job:
runs-on: ubuntu-latest
timeout-minutes: 15
services:
dynamodb:
image: amazon/dynamodb-local:1.16.0
ports:
- 8000:8000
# @note Github overwrites WORKDIR to repository path, so overwrite that again
options: >-
--workdir /home/dynamodblocal
--health-cmd "curl --fail http://127.0.0.1:8000/shell/ || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '18.x' # @node-upgrade
cache: npm
- name: Install node dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm test
env:
DYNAMO_ENDPOINT: http://localhost:8000
- name: Publish
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# npm will not execute `prepublisnOnly` lifecycle hook if user is root.
# @see https://github.com/semantic-release/semantic-release/issues/956#issuecomment-431097773
run: |
npm run prepublishOnly
npx semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}