Skip to content

Commit 2c62f5a

Browse files
committed
Update GitHub push action
1 parent 058fea6 commit 2c62f5a

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@ on:
44
push:
55
branches: ['master']
66

7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
711
jobs:
812
build-and-push-image:
913
runs-on: ubuntu-latest
1014

15+
permissions:
16+
contents: read
17+
packages: write
18+
attestations: write
19+
id-token: write
20+
1121
strategy:
1222
matrix:
1323
include:
@@ -17,26 +27,28 @@ jobs:
1727

1828
steps:
1929
- name: Checkout repository
20-
uses: actions/checkout@v2
30+
uses: actions/checkout@v4
2131

2232
- name: Set up QEMU
2333
uses: docker/setup-qemu-action@v1
2434

2535
- name: Set up Docker Buildx
2636
uses: docker/setup-buildx-action@v1
2737

28-
- name: Log in to DockerHub
29-
uses: docker/login-action@v1
38+
- name: Log in to the Container registry
39+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
3040
with:
31-
username: ${{ secrets.DOCKERHUB_USERNAME }}
32-
password: ${{ secrets.DOCKERHUB_TOKEN }}
41+
registry: ${{ env.REGISTRY }}
42+
username: ${{ github.actor }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
3344

3445
- name: Build and push Docker image
35-
uses: docker/build-push-action@v2
46+
uses: docker/build-push-action@v6
3647
with:
3748
context: .
49+
file: ./Dockerfile
3850
push: true
39-
tags: masa-finance/postgres-backup-s3:${{ matrix.postgres }}
51+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.postgres }}
4052
build-args: |
4153
ALPINE_VERSION=${{ matrix.alpine }}
4254
platforms: |

0 commit comments

Comments
 (0)