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
Ivan Schaller 51996b4b33
Some checks failed
run tests / run-container (push) Failing after 5s
add debug and fix printf
2023-08-16 11:56:27 +02:00
.gitea/workflows add debug and fix printf 2023-08-16 11:56:27 +02:00
.gitignore update image 2023-08-16 11:20:10 +02:00
action.yml add debug and fix printf 2023-08-16 11:56:27 +02:00
Dockerfile Upgrade to more recent image of Docker 2021-03-16 10:40:17 -04:00
entrypoint.sh add debug and fix printf 2023-08-16 11:56:27 +02:00
README.md fix multiline 2023-08-16 11:44:42 +02:00
test.yml fix multiline 2023-08-16 11:44:42 +02:00

Docker Run Action

features:

  • run a specific step/command in i docker image
  • run an image built by a previous step
  • See action.yml for all the available inputs

Examples

Typical Use Case

- name: Checkout
  uses: actions/checkout@v3 # Required to mount the Github Workspace to a volume

- uses: git.44net.ch/actions/docker-run-action@v1
  env:
      ABC: 123
  with:
      username: ${{ secrets.DOCKER_USERNAME }}
      password: ${{ secrets.DOCKER_PASSWORD }}
      registry: ghcr.io
      image: some-image:latest
      volumes: >-
          ./testscript.sh:/testscript.sh
          /abc/def:/tmp          
      options: >-
          --user abc          
      run: >-
          /bin/bash
          /testscript.sh          

run a privately-owned image

- uses: git.44net.ch/actions/docker-run-action@v1
  with:
      username: ${{ secrets.DOCKER_USERNAME }}
      password: ${{ secrets.DOCKER_PASSWORD }}
      registry: gcr.io
      image: some-image:latest
      run: echo "hello world"

run an image built by a previous step

- uses: docker/build-push-action@v2
  with:
      tags: some-image:latest
      push: false

- uses: git.44net.ch/actions/docker-run-action@v1
  with:
      image: some-image:latest
      run: echo "hello world"

use a specific shell (default: sh).

Note: The shell must be installed in the container

- uses: git.44net.ch/actions/docker-run-action@v1
  with:
      image: docker:latest
      shell: bash
      run: >-
          echo "first line"
          echo "second line"