Giter VIP home page Giter VIP logo

dockerrun-action's Introduction

DockerRun-Action

This is a simple action to run a docker image in a github action workflow. It only offers the bare minimum of options, however, further options might be added in the future.

The following options are available:

  • image (required) - Docker image
  • registry - Container registry
  • username - Docker username
  • password - Docker password
  • options - Docker options
  • run - Run command in container

How to use this action

It is recommended to set the credentials needed for this action as secrets, you can do this in your repository settings.

An action to run a privately owned docker image could look like the following:

on:
  workflow_dispatch:

jobs:
  docker:
    name: Run privately owned image
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: Run Image
        uses: c-schicho/DockerRun-Action@v1
        with:
          username: ${{ secrets.USERNAME }}
          password: ${{ secrets.PASSWORD }}
          registry: ghcr.io
          image: image:latest
          options: -p 80:80
          run: echo "hello world"

An action to run a docker imaged built by a previous step could look like the following:

on:
  workflow_dispatch:

jobs:
  docker:
    name: Run image built by previous step
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: Build docker image
        ...
      - name: Run Image
        uses: c-schicho/DockerRun-Action@v1
        with:
          image: image:latest
          options: -p 80:80
          run: echo "hello world"

dockerrun-action's People

Contributors

c-schicho avatar

Watchers

 avatar

dockerrun-action's Issues

update readme

write a short documentation on how to use this action.

ensure pipeline fails

ensure that when the script in the container has a non-zero exit status, that the whole step in the action fails.

create the initial action

the action should work as follows:
the code which is necessary to run the tests should already be prepared as a docker image on a registry. the actions should pull the image and run run it. afterwards it should post the results on the pull request or just show a summary in the action log (posting the results can also be done in a follow-up).

for this the action needs the following parameters:

  • github pat
  • registry user
  • path to docker image

fix permision error

currently there is an error in the docker file.

instead of adding the execution permission to the entrypoint script we remove it there. thus the action cannot execute it.

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.