Skip to content

Clarify use cases for runCmd #370

@davetapley

Description

@davetapley

I found this action because I wanted to use my devcontainer in an Action.

At first this Action seemed like exactly what I needed, but I got stuck with #302.
That led me to realize I should use this Action to build the image:

jobs:
    build:
      name: Pre-build dev container image
      runs-on: ubuntu-latest
      steps:
        - name: Checkout
          uses: actions/checkout@v3

        - name: Login to GitHub Container Registry
          uses: docker/login-action@v2 
          with:
            registry: ghcr.io
            username: ${{ github.repository_owner }}
            password: ${{ secrets.GITHUB_TOKEN }}

        - name: Pre-build dev container image
          uses: devcontainers/[email protected]
          with:
              imageName: ghcr.io/foo/bar
              cacheFrom: ghcr.io/foo/bar
              push: 'always'

But then for actually running steps inside the container you can use jobs.<job_id>.container instead of runCmd:

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/foo/bar:latest
      credentials:
         username: ${{ github.actor }}
         password: ${{ secrets.GITHUB_TOKEN }}
      options: --privileged

    steps:
        - uses: actions/checkout@v3

Note that also allows me to use options: --privileged (for kota65535/github-openvpn-connect-action#40 (comment)).


So, question: Why would someone use runCmd, just to save time?
And if so can the readme / docs clarify that jobs.<job_id>.container is another option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions