Skip to content

Commit e654cac

Browse files
author
niki
committed
debug: +
1 parent 53e19d4 commit e654cac

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

.github/workflows/publish-image.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,38 @@ name: Publish image
22
on:
33
push:
44
branches: [ master ]
5+
env:
6+
REGISTRY: ghcr.io
7+
IMAGE_NAME: ${{ github.repository }}
58

69
jobs:
7-
push_to_registries:
8-
name: Push Docker image to multiple registries
10+
build-and-push-image:
911
runs-on: ubuntu-latest
1012
permissions:
11-
packages: write
1213
contents: read
14+
packages: write
15+
1316
steps:
14-
- name: Check out the repo
17+
- name: Checkout repository
1518
uses: actions/checkout@v3
1619

17-
# - name: Log in to Docker Hub
18-
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
19-
# with:
20-
# username: ${{ secrets.DOCKER_USERNAME }}
21-
# password: ${{ secrets.DOCKER_PASSWORD }}
22-
2320
- name: Log in to the Container registry
2421
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
2522
with:
26-
registry: ghcr.io
23+
registry: ${{ env.REGISTRY }}
2724
username: ${{ github.actor }}
2825
password: ${{ secrets.GITHUB_TOKEN }}
2926

3027
- name: Extract metadata (tags, labels) for Docker
3128
id: meta
3229
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
3330
with:
34-
images: |
35-
my-docker-hub-namespace/my-docker-hub-repository
36-
ghcr.io/${{ github.repository }}
31+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3732

38-
- name: Build and push Docker images
33+
- name: Build and push Docker image
3934
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
4035
with:
4136
context: .
4237
push: true
4338
tags: ${{ steps.meta.outputs.tags }}
4439
labels: ${{ steps.meta.outputs.labels }}
45-
46-

0 commit comments

Comments
 (0)