-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (44 loc) · 1.01 KB
/
redis-container-example.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
name: Redis Service Example
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
container-job:
runs-on: ubuntu-latest
container:
image: node:10.18-jessie
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- run: npm ci # N.B: we need to run npm ci on redis folder to download redis dependency !!!
working-directory: ./redis
- run: node client.js
working-directory: ./redis
env:
REDIS_HOST: redis
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
vm-job:
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379/tcp
options: --entrypoint redis-server
steps:
- uses: actions/checkout@v2
- run: npm ci
working-directory: ./redis
- run: node client.js
working-directory: ./redis
env:
REDIS_HOST: localhost
REDIS_PORT: ${{ job.services.redis.ports[6379] }}