@@ -3,14 +3,7 @@ name: Build and Push Docker Image
3
3
on :
4
4
push :
5
5
branches :
6
- - main
7
- - master
8
- tags :
9
- - ' v*'
10
- pull_request :
11
- branches :
12
- - main
13
- - master
6
+ - js-flyio-dev
14
7
15
8
env :
16
9
REGISTRY : docker.io
@@ -34,24 +27,20 @@ jobs:
34
27
35
28
- name : Set up Docker Buildx
36
29
uses : docker/setup-buildx-action@v3
30
+
37
31
- name : Log in to Docker Hub
38
- if : github.event_name != 'pull_request'
39
32
uses : docker/login-action@v3
40
33
with :
41
34
username : ${{ secrets.FLYIOBUILDS_DOCKERHUB_USERNAME }}
42
35
password : ${{ secrets.FLYIOBUILDS_DOCKERHUB_TOKEN }}
36
+
43
37
- name : Extract metadata (tags, labels) for Docker
44
38
id : meta
45
39
uses : docker/metadata-action@v5
46
40
with :
47
41
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
48
42
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
55
44
56
45
- name : Get PGMonitor
57
46
run : make get-pgmonitor
61
50
with :
62
51
context : .
63
52
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
67
55
tags : ${{ steps.meta.outputs.tags }}
68
56
labels : ${{ steps.meta.outputs.labels }}
69
57
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