Giter Club home page Giter Club logo

docker-compose-action's Introduction

Docker Compose Action

This action runs your docker-compose file, allows you to run tests and cleans up before action finished.

Inputs

compose-file

Optional The name of the compose file. Default "./docker-compose.yml".

It can be a list of files:

compose-file: |
  docker-compose.yml
  docker-compose.ci.yml

services

Optional Just perform docker-compose up to one service instead of all of them

up-flags

Optional Used to specify flags to pass to the docker-compose up. Default is none. Can be used to pass the --build flag, for example, if you want persistent volumes to be deleted as well during cleanup. A full list of flags can be found in the docker-compose up documentation.

down-flags

Optional Used to specify flags to pass to the docker-compose down command during cleanup. Default is none. Can be used to pass the --volumes flag, for example, if you want persistent volumes to be deleted as well during cleanup. A full list of flags can be found in the docker-compose down documentation.

compose-flags

Optional Used to specify flags to pass to the docker-compose command. Default is none. A full list of flags can be found in the docker-compose documentation.

test-container

Optional Used to specify the container to run the tests in. Default is none. If not specified, no tests will be run.

test-command

Optional Used to specify the command to run the tests with. Default is none. If not specified, no tests will be run.

Example usage

steps:
  # need checkout before using docker-compose-action
  - uses: actions/checkout@v3
  - uses: adambirds/[email protected]
    with:
      compose-file: "./docker/docker-compose.yml"
      down-flags: "--volumes"
      services: |
        helloworld2
        helloworld3
      test-container: helloworld
      test-command: "npm test"

Using environment variables

steps:
  - uses: actions/checkout@v3
  - uses: adambirds/[email protected]
    with:
      compose-file: "./docker/docker-compose.yml"
    env:
      CUSTOM_VARIABLE: "test"

Run tests on multiple containers

steps:
  - uses: actions/checkout@v3
  - uses: adambirds/[email protected]
    with:
      compose-file: "./docker/docker-compose.yml"
      test-container: "container1"
      test-command: "npm test"

  - uses: adambirds/[email protected]
    with:
      compose-file: "./docker/docker-compose.yml"
      test-container: "container2"
      test-command: "npm test"

  - uses: adambirds/[email protected]
    with:
      compose-file: "./docker/docker-compose.yml"
      test-container: "container3"
      test-command: "npm test"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.