commit
224466dd5f
|
@ -0,0 +1,21 @@
|
||||||
|
name: Start Redis server from a custom image
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
redis-action:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
redis-version: [6.2.4-v4, 6.2.6-v3]
|
||||||
|
|
||||||
|
name: Start Redis Stack Server v${{ matrix.redis-version }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Start Redis Stack Server
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
redis-image: redis/redis-stack-server
|
||||||
|
redis-version: ${{ matrix.redis-version }}
|
|
@ -1,6 +1,12 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
||||||
|
## [1.5.0](https://github.com/superchargejs/redis-github-action/compare/v1i.4.0...v1.5.0) - 2023-02-xx
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- use a custom Redis image: useful if you need to run an alternative Redis image like Redis Stack
|
||||||
|
|
||||||
|
|
||||||
## [1.4.0](https://github.com/superchargejs/redis-github-action/compare/v1.3.0...v1.4.0) - 2021-12-28
|
## [1.4.0](https://github.com/superchargejs/redis-github-action/compare/v1.3.0...v1.4.0) - 2021-12-28
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
33
README.md
33
README.md
|
@ -56,7 +56,7 @@ jobs:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Start Redis
|
- name: Start Redis
|
||||||
uses: supercharge/redis-github-action@1.4.0
|
uses: supercharge/redis-github-action@1.5.0
|
||||||
with:
|
with:
|
||||||
redis-version: ${{ matrix.redis-version }}
|
redis-version: ${{ matrix.redis-version }}
|
||||||
|
|
||||||
|
@ -68,6 +68,33 @@ jobs:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Using a Custom Redis Image
|
||||||
|
You can utilize an alternative Redis image using the `redis-image` input:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: Run tests
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [14.x, 16.x]
|
||||||
|
redis-version: [6.2.4-v4, 6.2.6-v3]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Start Redis
|
||||||
|
uses: supercharge/redis-github-action@1.5.0
|
||||||
|
with:
|
||||||
|
redis-image: redis/redis-stack-server
|
||||||
|
redis-version: ${{ matrix.redis-version }}
|
||||||
|
|
||||||
|
- name: …
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Using Redis on a Custom Port
|
### Using Redis on a Custom Port
|
||||||
You can start the Redis instance on a custom port using the `redis-port` input:
|
You can start the Redis instance on a custom port using the `redis-port` input:
|
||||||
|
|
||||||
|
@ -86,7 +113,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Start Redis
|
- name: Start Redis
|
||||||
uses: supercharge/redis-github-action@1.4.0
|
uses: supercharge/redis-github-action@1.5.0
|
||||||
with:
|
with:
|
||||||
redis-version: ${{ matrix.redis-version }}
|
redis-version: ${{ matrix.redis-version }}
|
||||||
redis-port: 12345
|
redis-port: 12345
|
||||||
|
@ -113,7 +140,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Start Redis
|
- name: Start Redis
|
||||||
uses: supercharge/redis-github-action@1.4.0
|
uses: supercharge/redis-github-action@1.5.0
|
||||||
with:
|
with:
|
||||||
redis-version: ${{ matrix.redis-version }}
|
redis-version: ${{ matrix.redis-version }}
|
||||||
redis-container-name: redis-auth-token-cache
|
redis-container-name: redis-auth-token-cache
|
||||||
|
|
|
@ -6,6 +6,10 @@ branding:
|
||||||
color: 'red'
|
color: 'red'
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
redis-image:
|
||||||
|
description: 'Redis image to use. Useful if you need to run a custom Redis image'
|
||||||
|
required: false
|
||||||
|
default: 'redis'
|
||||||
redis-version:
|
redis-version:
|
||||||
description: 'Redis version to use'
|
description: 'Redis version to use'
|
||||||
required: false
|
required: false
|
||||||
|
@ -23,6 +27,7 @@ runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
args:
|
args:
|
||||||
|
- ${{ inputs.redis-image }}
|
||||||
- ${{ inputs.redis-version }}
|
- ${{ inputs.redis-version }}
|
||||||
- ${{ inputs.redis-port }}
|
- ${{ inputs.redis-port }}
|
||||||
- ${{ inputs.redis-container-name }}
|
- ${{ inputs.redis-container-name }}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
REDIS_VERSION=$1
|
REDIS_IMAGE=$1
|
||||||
REDIS_PORT=$2
|
REDIS_VERSION=$2
|
||||||
REDIS_CONTAINER_NAME=$3
|
REDIS_PORT=$3
|
||||||
|
REDIS_CONTAINER_NAME=$4
|
||||||
|
|
||||||
if [ -z "$REDIS_VERSION" ]; then
|
if [ -z "$REDIS_VERSION" ]; then
|
||||||
echo "Missing Redis version in the [redis-version] input. Received value: $REDIS_VERSION"
|
echo "Missing Redis version in the [redis-version] input. Received value: $REDIS_VERSION"
|
||||||
|
@ -11,4 +12,4 @@ if [ -z "$REDIS_VERSION" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting single-node Redis instance"
|
echo "Starting single-node Redis instance"
|
||||||
docker run --name $REDIS_CONTAINER_NAME --publish $REDIS_PORT:6379 --detach redis:$REDIS_VERSION
|
docker run --name $REDIS_CONTAINER_NAME --publish $REDIS_PORT:6379 --detach $REDIS_IMAGE:$REDIS_VERSION
|
||||||
|
|
Loading…
Reference in New Issue