File tree 1 file changed +19
-10
lines changed
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
2
2
3
3
on :
4
4
push :
5
- branches : [ "main" ]
5
+ branches : ["main"]
6
6
pull_request :
7
- branches : [ "main" ]
7
+ branches : ["main"]
8
8
9
9
env :
10
- IMAGE_NAME : vancouver-blocks
10
+ IMAGE_NAME : shinylive-nginx
11
11
VERSION : latest
12
12
CONTEXT : shinylive_without_quarto
13
13
14
14
jobs :
15
-
16
15
build :
17
-
18
16
runs-on : ubuntu-latest
19
17
20
18
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