add docker run command to docker-test.yml

pull/700/head
Patrick Devaney 1 week ago
parent 61ba7a8e9c
commit eeb78957af

@ -1,4 +1,4 @@
name: Docker Build and Run name: Docker Build and Test
on: on:
push: push:
@ -9,19 +9,19 @@ on:
- main - main
jobs: jobs:
docker: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Checkout the code # Checkout the repository
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
# Set up Docker Buildx (for multi-platform support, optional) # Set up Docker Buildx (optional, for multi-platform support)
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
# Cache Docker layers to speed up builds # Cache Docker layers to speed up builds (optional)
- name: Cache Docker layers - name: Cache Docker layers
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
@ -30,17 +30,17 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-buildx- ${{ runner.os }}-buildx-
# Build the Docker image from the ./tests directory # Build Docker image from the ./tests directory
- name: Build Docker image - name: Build Docker image
run: | run: |
docker build -t test-runner:swarm-testing ./tests docker build -t test-runner:swarm-testing ./tests
# Create a logs directory and pass the OpenAI API Key securely # Ensure logs directory exists in the GitHub workspace
- name: Ensure logs directory exists - name: Ensure logs directory exists
run: | run: |
mkdir -p ${{ github.workspace }}/logs mkdir -p ${{ github.workspace }}/logs
# Run Docker container and pass OpenAI API Key securely # Run Docker container with OpenAI API Key securely
- name: Run Docker container - name: Run Docker container with OpenAI API Key
run: | run: |
docker run -e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} -v ${{ github.workspace }}/logs:/usr/src/app/logs test-runner:swarm-testing docker run -e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} -v ${{ github.workspace }}/logs:/usr/src/app/logs test-runner:swarm-testing

Loading…
Cancel
Save