Skip to content

Commit 4816618

Browse files
committed
try again
1 parent 9d10ed8 commit 4816618

File tree

1 file changed

+7
-26
lines changed

1 file changed

+7
-26
lines changed

.github/workflows/docker-build.yml

+7-26
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@ name: Build and Push Docker Image
33
on:
44
push:
55
branches:
6-
- main
7-
- master
8-
tags:
9-
- 'v*'
10-
pull_request:
11-
branches:
12-
- main
13-
- master
6+
- js-flyio-dev
147

158
env:
169
REGISTRY: docker.io
@@ -34,24 +27,20 @@ jobs:
3427

3528
- name: Set up Docker Buildx
3629
uses: docker/setup-buildx-action@v3
30+
3731
- name: Log in to Docker Hub
38-
if: github.event_name != 'pull_request'
3932
uses: docker/login-action@v3
4033
with:
4134
username: ${{ secrets.FLYIOBUILDS_DOCKERHUB_USERNAME }}
4235
password: ${{ secrets.FLYIOBUILDS_DOCKERHUB_TOKEN }}
36+
4337
- name: Extract metadata (tags, labels) for Docker
4438
id: meta
4539
uses: docker/metadata-action@v5
4640
with:
4741
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4842
tags: |
49-
type=ref,event=branch
50-
type=ref,event=pr
51-
type=semver,pattern={{version}}
52-
type=semver,pattern={{major}}.{{minor}}
53-
type=sha,format=long
54-
type=raw,value=latest,enable={{is_default_branch}}
43+
type=sha,format=short
5544
5645
- name: Get PGMonitor
5746
run: make get-pgmonitor
@@ -61,17 +50,9 @@ jobs:
6150
with:
6251
context: .
6352
file: ./build/postgres-operator/Dockerfile
64-
push: ${{ github.event_name != 'pull_request' }}
65-
load: ${{ github.event_name == 'pull_request' }}
66-
platforms: ${{ github.event_name != 'pull_request' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
53+
push: true
54+
platforms: linux/amd64
6755
tags: ${{ steps.meta.outputs.tags }}
6856
labels: ${{ steps.meta.outputs.labels }}
6957
cache-from: type=gha
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
58+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)