No description
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.
Find a file
Linas Daneliukas aeee02d5ef Fix typo
2021-07-09 11:58:47 +03:00
.github/workflows test: add container network test 2021-02-15 17:13:07 -05:00
.gitignore setup docker run action 2020-06-17 18:47:31 -04:00
action.yml Fix typo 2021-07-09 11:58:47 +03:00
Dockerfile Upgrade to more recent image of Docker 2021-03-16 10:40:17 -04:00
entrypoint.sh Mount the workspace and set as default workdir 2021-07-09 11:19:53 +03:00
LICENSE Initial commit 2020-06-17 17:53:48 -04:00
README.md remove workspace volume from example 2021-07-09 11:33:42 +03:00
RELEASES.md Update RELEASES.md 2021-03-17 13:00:15 -04:00

Docker Run Action

Examples

Typical Use Case

- name: Checkout 
  uses: actions/checkout@v2 # Required to mount the Github Workspace to a volume 
- uses: addnab/docker-run-action@v3
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}
    registry: gcr.io
    image: private-image:latest
    options: -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"