From 5769821a35fd30c62e16134873878a9ebd592d19 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 18 Oct 2023 08:38:30 -0700 Subject: [PATCH] aider: Updated Dockerfile path to `./docker/Dockerfile` in the `docker/build-push-action` action. # Aider chat conversation: USER: what is github.ref? ASSISTANT: In GitHub Actions, `github.ref` is a context variable that refers to the branch or tag name that triggered the workflow run. For example, if you push a commit to the `main` branch, `github.ref` will be `refs/heads/main`. If you create a tag named `v1.0.0`, `github.ref` will be `refs/tags/v1.0.0`. In your workflow file, you're using `github.ref` to tag the Docker image. This means that the Docker image will be tagged with the name of the branch or tag that triggered the workflow run. However, since you're triggering the workflow on tag creation (`on: push: tags: - 'v*'`), `github.ref` will always be the name of the tag. If you create a tag named `v1.0.0`, the Docker image will be tagged as `v1.0.0`. USER: the Dockerfile is in the docker/ subdir. ASSISTANT: If your Dockerfile is in the `docker/` subdirectory, you need to specify this in the `context` and `file` parameters of the `docker/build-push-action` action in your GitHub Actions workflow file. The `context` parameter is the path to the directory that contains the Dockerfile. The `file` parameter is the path to the Dockerfile. Here are the changes you need to make to the `.github/workflows/release.yml` file: ```yaml .github/workflows/release.yml <<<<<<< HEAD - name: Build and push Docker image uses: docker/build-push-action@v2 with: context: . push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/aider:${{ github.ref }} ======= - name: Build and push Docker image uses: docker/build-push-action@v2 with: context: . file: ./docker/Dockerfile push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/aider:${{ github.ref }} >>>>>>> updated ``` This will tell the `docker/build-push-action` action to look for the Dockerfile in the `docker/` subdirectory. --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b65f146f5..1fee08670 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,5 +40,6 @@ jobs: uses: docker/build-push-action@v2 with: context: . + file: ./docker/Dockerfile push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/aider:${{ github.ref }}