Go to file
Ivan Schaller e0e70e3b67
run tests / run-container (push) Successful in 12s Details
Merge pull request 'chore(deps): update docker docker tag to v26' (#6) from renovate/docker-26.x into main
Reviewed-on: #6
2024-04-16 12:37:58 +02:00
.gitea/workflows add debug for env vars 2023-08-16 12:16:35 +02:00
.gitignore update image 2023-08-16 11:20:10 +02:00
Dockerfile chore(deps): update docker docker tag to v26 2024-03-21 08:12:44 +01:00
README.md fix multiline 2023-08-16 11:44:42 +02:00
action.yml make entrypoint optional 2023-08-16 12:10:20 +02:00
entrypoint.sh fix debug 2023-08-16 12:25:43 +02:00
renovate.json update renovate path 2023-12-05 13:38:37 +01:00
test.yml fix multiline 2023-08-16 11:44:42 +02:00

README.md

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"