This repository has been archived on 2024-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
docker-run-action/README.md
Yossi Farjoun b9fe748ee2 parent 358af5c600
author Yossi Farjoun <farjoun@broadinstitute.org> 1617479686 -0400
committer Yossi Farjoun <farjoun@broadinstitute.org> 1618455120 -0400

Change the way the script is run. instead of modfying the ENTRYPOINT, we will simply add the "shell" (default sh) and the "script_prefix" (default -c)
and then the script.

That way the possible comple entry point is not disturbed. if a user would like to remove the ENTRYPOINT they can provide an "option" "--entrypoint ''" for example.
2021-04-14 23:06:04 -04:00

1.3 KiB

Docker Run Action

Examples

Typical Use Case

- uses: addnab/docker-run-action@v3
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}
    registry: gcr.io
    image: private-image:latest
    options: -v ${{ github.workspace }}:/work -e ABC=123
    run: |
      echo "Running Script"
      /work/run-script      

run a privately-owned image

- uses: addnab/docker-run-action@v3
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}
    registry: gcr.io
    image: test-image:latest
    run: echo "hello world"

run an image built by a previous step

- uses: docker/build-push-action@v2
  with:
    tags: test-image:latest
    push: false
- uses: addnab/docker-run-action@v3
  with:
    image: test-image:latest
    run: echo "hello world"

use a specific shell (default: sh).

Note: The shell must be installed in the container

- uses: addnab/docker-run-action@v3
  with:
    image: docker:latest
    shell: bash
    run: |
      echo "first line"
      echo "second line"