Skip to content

Do not build container actions ahead of time #814

@umarcor

Description

@umarcor
jobs:

  job:
    runs-on: ubuntu-latest
    steps:
    
    # BUG: GitHub's runner tries to build the last action before starting the first step.
    # It fails, because container image image_name does not exist yet.
    
    - name: Build hdlc/doc
      run: |
        docker build -t image_name - <<-EOF
        FROM asciidoctor/docker-asciidoctor
        RUN apk add -U --no-cache graphviz
        EOF
        
    - uses: actions/checkout@v2

    - uses: docker://image_name
      with:
        args: doc/make.sh

As a result, it is currently not possible to use local containers using the uses: docker:// syntax.

The alternative is to call docker explicitly, which requires handling all the environment manually (if necessary):

jobs:

  job:
    runs-on: ubuntu-latest
    steps:

    - name: Build hdlc/doc
      run: |
        docker build -t image_name - <<-EOF
        FROM asciidoctor/docker-asciidoctor
        RUN apk add -U --no-cache graphviz
        EOF

    - uses: actions/checkout@v2

    - name: Build site
      run: docker run -v /$(pwd)://documents/ image_name ./doc/make.sh

Using local docker images in container steps should be supported too.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions