elgohr/Publish-Docker-Github-Action@2.6: unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /github/workspace/Dockerfile: no such file or directory

Hello - im trying to use the CI/CD via a GH workflow but getting the below error:

Run elgohr/Publish-Docker-Github-Action@2.6
  with:
    name: ***/airflow:ci-9c4aa18da48e85e022e4759091c4d31fa14fa5e5
    username: _
    password: ***
    registry: registry.gcp0001.us-east4.astronomer.io
/usr/bin/docker run --name e1cc51330226e66d584be1800457d9cb5ecd28_3e391a --label e1cc51 --workdir /github/workspace --rm -e INPUT_NAME -e INPUT_USERNAME -e INPUT_PASSWORD -e INPUT_REGISTRY -e INPUT_SNAPSHOT -e INPUT_DOCKERFILE -e INPUT_WORKDIR -e INPUT_BUILDARGS -e INPUT_CACHE -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/analytics-bi/analytics-bi":"/github/workspace" e1cc51:330226e66d584be1800457d9cb5ecd28

WARNING! Your password will be stored unencrypted in /github/home/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /github/workspace/Dockerfile: no such file or directory

Iā€™m not quite sure what might be going on.

Below is my workflow: `

name: 'Astronomer'

on:
  push:
    paths:
      - airflow/**
    branches:
      - develop
      - master

jobs:
  dev-push:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Push to registry
      uses: elgohr/Publish-Docker-Github-Action@2.6
      if: github.ref == 'refs/heads/develop'
      with:
          name: ${{ secrets.ASTRO_DEPLOYMENT_RELEASE_NAME_DEV }}/airflow:ci-${{ github.sha }}
          username: _
          password: ${{ secrets.ASTRO_SERVICE_ACCOUNT_KEY }}
          registry: registry.gcp0001.us-east4.astronomer.io
  prod-push:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Push to registry
      uses: elgohr/Publish-Docker-Github-Action@2.6
      if: github.ref == 'refs/heads/master'
      with:
          name: ${{ secrets.ASTRO_DEPLOYMENT_RELEASE_NAME_PROD }}/airflow:ci-${{ github.sha }}
          username: _
          password: ${{ secrets.ASTRO_SERVICE_ACCOUNT_KEY }}
          registry: registry.gcp0001.us-east4.astronomer.io

Anyone any ideas?

hmm - actually - all my airflow/astronomer stuff lives in /airflow/ in my repo - maybe the action is expecting it all to live at the root level of the repo?

Yep - my bad, reading here - if i define

workdir: airflow

Then it works so this is what works for me - just sharing in case useful for anyone else.

name: 'Astronomer'

on:
  push:
    paths:
      - airflow/**
    branches:
      - develop
      - master

jobs:
  dev-push:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Push to registry
      uses: elgohr/Publish-Docker-Github-Action@2.6
      if: github.ref == 'refs/heads/develop'
      with:
          workdir: airflow
          name: ${{ secrets.ASTRO_DEPLOYMENT_RELEASE_NAME_DEV }}/airflow:ci-${{ github.sha }}
          username: _
          password: ${{ secrets.ASTRO_SERVICE_ACCOUNT_KEY }}
          registry: registry.gcp0001.us-east4.astronomer.io
  prod-push:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Push to registry
      uses: elgohr/Publish-Docker-Github-Action@2.6
      if: github.ref == 'refs/heads/master'
      with:
          workdir: airflow
          name: ${{ secrets.ASTRO_DEPLOYMENT_RELEASE_NAME_PROD }}/airflow:ci-${{ github.sha }}
          username: _
          password: ${{ secrets.ASTRO_SERVICE_ACCOUNT_KEY }}
          registry: registry.gcp0001.us-east4.astronomer.io
1 Like