File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -2,24 +2,33 @@ name: Docker Image CI
22
33on :
44 push :
5- branches : [ "main" ]
5+ branches : ["main"]
66 pull_request :
7- branches : [ "main" ]
7+ branches : ["main"]
88
99env :
10- IMAGE_NAME : vancouver-blocks
10+ IMAGE_NAME : shinylive-nginx
1111 VERSION : latest
1212 CONTEXT : shinylive_without_quarto
1313
1414jobs :
15-
1615 build :
17-
1816 runs-on : ubuntu-latest
1917
2018 steps :
21- - uses : actions/checkout@v4
22- - name : Build the Docker image
23- run : |
24- cd $CONTEXT
25- docker build . --file Dockerfile --tag $IMAGE_NAME:$(date +%s)
19+ - uses : actions/checkout@v4
20+ - name : Build the Docker image
21+ run : |
22+ cd $CONTEXT
23+ docker build . --file Dockerfile --tag $IMAGE_NAME:$VERSION
24+
25+ - name : Log in to registry
26+ run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u token --password-stdin
27+
28+ - name : Push image to ghcr.io
29+ run : |
30+ image_id=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
31+ # repository name must be lowercase
32+ image_id=$(echo $image_id | tr '[A-Z]' '[a-z]')
33+ docker tag $IMAGE_NAME:$VERSION $image_id:$VERSION
34+ docker push $image_id:$VERSION
You can’t perform that action at this time.
0 commit comments