-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (68 loc) · 2.21 KB
/
Copy pathPublish.yml
File metadata and controls
74 lines (68 loc) · 2.21 KB
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
name: Publish
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
# runs all of the steps inside the specified container rather than on the VM host.
# Because of this the network configuration changes from host based network to a container network.
container:
image: node:10.16-jessie
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mongo:
image: mongo:latest
ports:
- 27017:27017
strategy:
matrix:
node-version: [12.x, 13.x]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
- name: Checkout
uses: actions/checkout@v1
- name: Install
uses: borales/actions-yarn@v2.0.0
with:
cmd: install # will run `yarn install` command
- name: Build
uses: borales/actions-yarn@v2.0.0
with:
cmd: build # will run `yarn build` command
- name: Test
uses: borales/actions-yarn@v2.0.0
with:
cmd: test # will run `yarn test` command
- name: Test Integration
uses: borales/actions-yarn@v2.0.0
with:
cmd: integration # will run `yarn test` command
env:
# use postgres for the host here because we have specified a container for the job.
# If we were running the job on the VM this would be localhost
POSTGRES_HOST: postgres
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
POSTGRES_USER: "postgres"
MONGO_HOST: mongo
MONGO_PORT: ${{ job.services.mongo.ports[27017] }}
- name: Publish
if: contains(matrix.node-version, '13.x')
run: |
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
CI: true