Action doesn't perform git checkout
See original GitHub issueBehaviour
Expected behaviour
According to README:
By default, this action uses the Git context so you don’t need to use the actions/checkout action to checkout the repository because this will be done directly by buildkit.
Actual behaviour
Checkout doesn’t happen.
Configuration
This
- name: Build and push container
uses: docker/build-push-action@v2
with:
context: ./app
push: true
tags: ${{ env.ECR_REGISTRY }}/proxyco/madmax-api:stable
fails with error:
/usr/local/bin/docker buildx build --tag ***.dkr.ecr.us-west-2.amazonaws.com/proxyco/madmax-api:stable --iidfile /tmp/docker-build-push-s6cfCu/iidfile --metadata-file /tmp/docker-build-push-s6cfCu/metadata-file --push ./app
error: unable to prepare context: path "./app" not found
Error: buildx failed with: error: unable to prepare context: path "./app" not found
I have to explicitly do a checkout first, for the build to be successful.
- uses: actions/checkout@v2
- name: Build and push container
uses: docker/build-push-action@v2
with:
context: ./app
push: true
tags: ${{ env.ECR_REGISTRY }}/proxyco/madmax-api:stable
It’s a private repo.
This is run on a self-hosted runner using ubuntu-latest.
What am I doing wrong?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
github actions - issue in checkout action - Stack Overflow
When you want to use an action, you specify the action name and the version of the action to run. This line: -...
Read more >git-pull Documentation - Git
Incorporates changes from a remote repository into the current branch. If the current branch is behind the remote, then by default it will...
Read more >Git Pull | Atlassian Git Tutorial
The git pull command is used to fetch and download content from a remote repository and immediately update the local repository to match...
Read more >Why doesn't my GitHub Action run automatically from a fork ...
GitHub Actions and Pull Requests with Bdougie#30minutestomergeA quick tour of specific GitHub Actions triggers and their use, plus a deep ...
Read more >How do I force git pull to overwrite local files? - Tower Git Client
The reason for error messages like these is rather simple: you have local changes that would be overwritten by the incoming new changes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👍 I was working on a PR myself but you were much quicker! I’ve submitted mine as a friendly alternative.
You’re specifying a path context string (
./app
) which overrides the described automagic.It looks like you want to specify a subdir on your build. You can still have most of the automagic by specifying the context as a full git repo URL in the way described by the docker build docs’ description of Git Repo URLs. You’d use one with a trailing
:app
. Something like:To make it a bit more reusable you can do something like: