Skip to content

Commit e221d3b

Browse files
committed
switch to docker
1 parent df4b2b5 commit e221d3b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

.github/workflows/build-and-push.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ on:
66
- main
77

88
env:
9-
REGISTRY: ghcr.io
10-
IMAGE_NAME: ${{ github.repository }}/mpg-operator-postgres
9+
IMAGE_NAME: flyio/mpg-operator-postgres
1110

1211
jobs:
1312
build-and-push:
@@ -23,28 +22,32 @@ jobs:
2322
- name: Set up Docker Buildx
2423
uses: docker/setup-buildx-action@v3
2524

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
2828
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 }}
3231

3332
- name: Extract metadata for Docker
3433
id: meta
3534
uses: docker/metadata-action@v5
3635
with:
37-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
36+
images: ${{ env.IMAGE_NAME }}
3837
tags: |
3938
type=raw,value=latest
4039
type=sha,format=short
4140
4241
- name: Build and push Docker image
4342
uses: docker/build-push-action@v5
43+
id: docker_build
4444
with:
4545
context: .
4646
push: true
4747
tags: ${{ steps.meta.outputs.tags }}
4848
labels: ${{ steps.meta.outputs.labels }}
4949
cache-from: type=gha
5050
cache-to: type=gha,mode=max
51+
52+
- name: Image digest
53+
run: echo ${{ steps.docker_build.outputs.digest }}

0 commit comments

Comments
 (0)