ci: Update GitHub Actions workflow to use github.event_name for build conditions

This commit is contained in:
Paul Gauthier (aider) 2025-01-16 11:52:34 -08:00
parent d62c43bc95
commit c912b66a8f

View file

@ -36,14 +36,14 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build Docker images (PR)
if: ${{ secrets.DOCKERHUB_USERNAME == '' }}
if: ${{ github.event_name == 'pull_request' }}
uses: docker/build-push-action@v5
with:
context: .
@ -53,7 +53,7 @@ jobs:
target: aider
- name: Build Docker images (Push)
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}
if: ${{ github.event_name != 'pull_request' }}
uses: docker/build-push-action@v5
with:
context: .
@ -64,7 +64,7 @@ jobs:
target: aider
- name: Build Docker full image (PR)
if: ${{ secrets.DOCKERHUB_USERNAME == '' }}
if: ${{ github.event_name == 'pull_request' }}
uses: docker/build-push-action@v5
with:
context: .
@ -74,7 +74,7 @@ jobs:
target: aider-full
- name: Build Docker full image (Push)
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}
if: ${{ github.event_name != 'pull_request' }}
uses: docker/build-push-action@v5
with:
context: .