Skip to content

Commit 9d10ed8

Browse files
committed
fix workflow
1 parent a44ec9f commit 9d10ed8

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/docker-build.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ jobs:
3434

3535
- name: Set up Docker Buildx
3636
uses: docker/setup-buildx-action@v3
37-
3837
- name: Log in to Docker Hub
3938
if: github.event_name != 'pull_request'
4039
uses: docker/login-action@v3
4140
with:
42-
username: ${{ secrets.DOCKERHUB_USERNAME }}
43-
password: ${{ secrets.DOCKERHUB_TOKEN }}
44-
41+
username: ${{ secrets.FLYIOBUILDS_DOCKERHUB_USERNAME }}
42+
password: ${{ secrets.FLYIOBUILDS_DOCKERHUB_TOKEN }}
4543
- name: Extract metadata (tags, labels) for Docker
4644
id: meta
4745
uses: docker/metadata-action@v5
@@ -64,8 +62,16 @@ jobs:
6462
context: .
6563
file: ./build/postgres-operator/Dockerfile
6664
push: ${{ github.event_name != 'pull_request' }}
67-
platforms: linux/amd64,linux/arm64
65+
load: ${{ github.event_name == 'pull_request' }}
66+
platforms: ${{ github.event_name != 'pull_request' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
6867
tags: ${{ steps.meta.outputs.tags }}
6968
labels: ${{ steps.meta.outputs.labels }}
7069
cache-from: type=gha
71-
cache-to: type=gha,mode=max
70+
cache-to: type=gha,mode=max
71+
72+
# For pull requests, we want to test the image
73+
- name: Test image
74+
if: github.event_name == 'pull_request'
75+
run: |
76+
docker image inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.event.pull_request.number }}
77+
# Add any additional test commands here

0 commit comments

Comments
 (0)