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 a79a47dad9
All checks were successful
run tests / run-container (push) Successful in 5s
Merge pull request 'chore(deps): update docker docker tag to v24' (#2) from renovate/docker-24.x into main
Reviewed-on: #2
2023-08-16 19:29:53 +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
action.yml make entrypoint optional 2023-08-16 12:10:20 +02:00
Dockerfile chore(deps): update docker docker tag to v24 2023-08-16 19:25:55 +02:00
entrypoint.sh fix debug 2023-08-16 12:25:43 +02:00
README.md fix multiline 2023-08-16 11:44:42 +02:00
renovate.json Add renovate.json 2023-08-16 12:24:38 +00: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"