File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656 node-version : ${{ matrix.node-version }}
5757
5858 - name : Start Redis
59- uses : supercharge/redis-github-action@1.2 .0
59+ uses : supercharge/redis-github-action@1.3 .0
6060 with :
6161 redis-version : ${{ matrix.redis-version }}
6262
6868` ` `
6969
7070
71+ ### Using Redis on a Custom Port
72+ You can start the Redis instance on a custom port using the ` redis-port` input:
73+
74+ ` ` ` yaml
75+ name: Run tests
76+
77+ on: [push]
78+
79+ jobs:
80+ build:
81+ runs-on: ubuntu-latest
82+ strategy:
83+ matrix:
84+ node-version: [14.x, 16.x]
85+ redis-version: [4, 5, 6]
86+
87+ steps:
88+ - name: Start Redis
89+ uses: supercharge/redis-github-action@1.3.0
90+ with:
91+ redis-version: ${{ matrix.redis-version }}
92+ redis-port: 12345
93+
94+ - name: …
95+ ` ` `
96+
97+
7198# # License
7299MIT © [Supercharge](https://superchargejs.com)
73100
Original file line number Diff line number Diff line change @@ -10,9 +10,13 @@ inputs:
1010 description : ' Redis version to use'
1111 required : false
1212 default : ' latest'
13-
13+ redis-port :
14+ description : ' Redis port to use and expose'
15+ required : false
16+ default : 6379
1417runs :
1518 using : ' docker'
1619 image : ' Dockerfile'
1720 args :
1821 - ${{ inputs.redis-version }}
22+ - ${{ inputs.redis-port }}
Original file line number Diff line number Diff line change 11#! /bin/sh
22
33REDIS_VERSION=$1
4+ REDIS_PORT=$2
45
56if [ -z " $REDIS_VERSION " ]; then
67 echo " Missing Redis version in the [redis-version] input. Received value: $REDIS_VERSION "
@@ -9,4 +10,4 @@ if [ -z "$REDIS_VERSION" ]; then
910fi
1011
1112echo " Starting single-node Redis instance"
12- docker run --name redis --publish 6379 :6379 --detach redis:$REDIS_VERSION
13+ docker run --name redis --publish $REDIS_PORT :6379 --detach redis:$REDIS_VERSION
You can’t perform that action at this time.
0 commit comments