bezzoon
bezzoon

Reputation: 2019

How to pull a docker image and execute it from github actions

How does one pull an image from a github action. Specifically one that requires authentication:

    steps:
      - name: Pull Docker Image
        uses: docker/???
        image: image_host.com/image:latest

^^^ Is wrong and I am not sure what the right syntax is.

I want to then run a command inside of the action

      - name: Run test
        run: |
          node index.js # (index.js is inside of the container)
    ```

Upvotes: 1

Views: 941

Answers (1)

cwellm
cwellm

Reputation: 64

In order to use a GitHub workflow with a Docker container, you need a workflow runner which has Docker installed on its system, such as ubuntu-latest. Then use the container directive in order to pick a container.

Upvotes: 1

Related Questions