File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
- name : Create and publish a Docker image
1
+ name : Publish Docker image (GHRC)
2
2
3
3
on :
4
4
push :
7
7
env :
8
8
REGISTRY : ghcr.io
9
9
IMAGE_NAME : ${{ github.repository }}
10
+ USERNAME : ${{ github.actor }}
10
11
11
12
jobs :
12
- build-and-push-image :
13
+ push_to_registry_ghrc :
13
14
runs-on : ubuntu-latest
14
15
permissions :
15
16
contents : read
@@ -22,19 +23,21 @@ jobs:
22
23
uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
23
24
with :
24
25
registry : ${{ env.REGISTRY }}
25
- username : ${{ github.actor }}
26
+ username : ${{ env.USERNAME }}
26
27
password : ${{ secrets.TOKEN }}
27
28
28
29
- name : Extract metadata (tags, labels) for Docker
29
30
id : meta
30
31
uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
31
32
with :
32
- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33
+ tags : type=raw,value=latest
34
+ images : ${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}
33
35
34
36
- name : Build and push Docker image
35
37
uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
36
38
with :
37
39
context : .
40
+ file : Dockerfile
38
41
push : true
39
42
tags : ${{ steps.meta.outputs.tags }}
40
43
labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1
1
{
2
2
"cSpell.words" : [
3
3
" DOCKERHUB" ,
4
+ " ghrc" ,
4
5
" github"
5
6
]
6
7
}
You can’t perform that action at this time.
0 commit comments