6
6
- main
7
7
8
8
env :
9
- REGISTRY : ghcr.io
10
- IMAGE_NAME : ${{ github.repository }}/mpg-operator-postgres
9
+ IMAGE_NAME : flyio/mpg-operator-postgres
11
10
12
11
jobs :
13
12
build-and-push :
@@ -23,28 +22,32 @@ jobs:
23
22
- name : Set up Docker Buildx
24
23
uses : docker/setup-buildx-action@v3
25
24
26
- - name : Log in to the Container registry
27
- uses : docker/login-action@v3
25
+ - name : Login to DockerHub
26
+ if : github.event_name != 'pull_request'
27
+ uses : docker/login-action@v1
28
28
with :
29
- registry : ${{ env.REGISTRY }}
30
- username : ${{ github.actor }}
31
- password : ${{ secrets.GITHUB_TOKEN }}
29
+ username : ${{ secrets.FLYIOBUILDS_DOCKERHUB_USERNAME }}
30
+ password : ${{ secrets.FLYIOBUILDS_DOCKERHUB_TOKEN }}
32
31
33
32
- name : Extract metadata for Docker
34
33
id : meta
35
34
uses : docker/metadata-action@v5
36
35
with :
37
- images : ${{ env.REGISTRY }}/${{ env. IMAGE_NAME }}
36
+ images : ${{ env.IMAGE_NAME }}
38
37
tags : |
39
38
type=raw,value=latest
40
39
type=sha,format=short
41
40
42
41
- name : Build and push Docker image
43
42
uses : docker/build-push-action@v5
43
+ id : docker_build
44
44
with :
45
45
context : .
46
46
push : true
47
47
tags : ${{ steps.meta.outputs.tags }}
48
48
labels : ${{ steps.meta.outputs.labels }}
49
49
cache-from : type=gha
50
50
cache-to : type=gha,mode=max
51
+
52
+ - name : Image digest
53
+ run : echo ${{ steps.docker_build.outputs.digest }}
0 commit comments