aider: Updated build and push action to include the ":latest" tag when pushing the Docker image.

# Aider chat conversation:

USER: i also want to update :latest when i push

ASSISTANT: To update the `:latest` tag each time you push, you can add it to the `tags` parameter of the `docker/build-push-action` action in your workflow file. This will build and push the Docker image with both the branch or tag name and `latest` as tags.

Here's how you can update your workflow file:

```yaml
.github/workflows/release.yml
<<<<<<< HEAD
    - name: Build and push Docker image
      uses: docker/build-push-action@v5
      with:
        context: .
        file: ./docker/Dockerfile
        push: true
        tags: ${{ secrets.DOCKERHUB_USERNAME }}/aider:${{ github.ref_name }}
=======
    - name: Build and push Docker image
      uses: docker/build-push-action@v5
      with:
        context: .
        file: ./docker/Dockerfile
        push: true
        tags: |
          ${{ secrets.DOCKERHUB_USERNAME }}/aider:${{ github.ref_name }}
          ${{ secrets.DOCKERHUB_USERNAME }}/aider:latest
>>>>>>> updated
```

This will ensure that the `:latest` tag always points to the most recently pushed image.
This commit is contained in:
Paul Gauthier 2023-10-18 09:05:53 -07:00
parent 87296ddcee
commit 44afdeff25

View file

@ -43,4 +43,6 @@ jobs:
context: .
file: ./docker/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/aider:${{ github.ref_name }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/aider:${{ github.ref_name }}
${{ secrets.DOCKERHUB_USERNAME }}/aider:latest