-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action doesn't perform git checkout #528
Comments
You're specifying a path context string ( 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 context: https://github.com/proxyco/madmax-api.git#${{ env.GITHUB_REF }}:app To make it a bit more reusable you can do something like: jobs:
buildo:
runs-on: ubuntu-latest
env:
CONTEXT_SUBDIR: app
steps:
- name: Login to ECR
uses: docker/login-action@v1
with:
# your ecr details here
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push container
uses: docker/build-push-action@v2
with:
context: "${{ github.server_url }}/${{ github.repository }}.git#${{ github.ref }}:${{ env.CONTEXT_SUBDIR }}"
push: true
tags: ${{ env.ECR_REGISTRY }}/proxyco/madmax-api:stable
|
There is a related feature request in: #460 |
Thanks for the response @actualben ! Also, thanks for the suggested workaround, although not pretty, haha. :) I might take a stab at that feature request, if you'll allow me? |
Since v0.9.0 of BuildKit (BuildX v0.7.0) you can provide a subdirectory to the default Git context. Closes docker#460 Closes docker#528
Since v0.9.0 of BuildKit (BuildX v0.7.0) you can provide a subdirectory to the default Git context. Closes docker#460 Closes docker#528 Signed-off-by: Jim Brännlund <jimbrannlund@fastmail.com>
I went ahead and added a PR. Hope you approve! 😊 |
Since v0.9.0 of BuildKit (BuildX v0.7.0) you can provide a subdirectory to the default Git context. Closes docker#460 Closes docker#528 Signed-off-by: Jim Brännlund <jimbrannlund@fastmail.com>
👍 I was working on a PR myself but you were much quicker! I've submitted mine as a friendly alternative. |
Since v0.9.0 of BuildKit (BuildX v0.7.0) you can provide a subdirectory to the default Git context. Closes docker#460 Closes docker#528 Signed-off-by: Jim Brännlund <jimbrannlund@fastmail.com>
Behaviour
Expected behaviour
According to README:
Actual behaviour
Checkout doesn't happen.
Configuration
This
fails with error:
I have to explicitly do a checkout first, for the build to be successful.
It's a private repo.
This is run on a self-hosted runner using ubuntu-latest.
What am I doing wrong?
The text was updated successfully, but these errors were encountered: