File tree Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change 1
1
name : Docker Image CI/CD
2
-
3
2
on :
4
3
push :
5
4
branches :
6
5
- master
7
6
8
7
jobs :
9
-
10
8
build :
11
-
12
9
runs-on : ubuntu-latest
10
+ env :
11
+ SERVICE_NAME : ghcr.io/platformercloud/git-mirror-gsr
12
+ CONTAINER_REGISTRY : ghcr.io
13
13
14
14
steps :
15
15
- uses : actions/checkout@v2
16
- name : Checkout
17
-
18
- - name : Directory Change
19
- working-directory : ./gsr-mirror
20
- run : echo $(pwd) && ls -a
21
-
22
- - name : Image Build Push
23
- uses : docker/build-push-action@v2
16
+ - name : Set Version
17
+ id : event-version
18
+ run : echo ::set-output
19
+ name=SOURCE_TAG::${GITHUB_REF#refs/heads/}-${{github.sha}}
20
+ - name : Login to GitHub Container Registry
21
+ uses : docker/login-action@v1
24
22
with :
25
- context : ./gsr-mirror
23
+ registry : ${{ env.CONTAINER_REGISTRY }}
26
24
username : ${{ github.actor }}
27
25
password : ${{ secrets.TOKEN }}
28
- registry : ghcr.io
29
- repository : platformercloud/git-mirror-gsr
30
- tag_with_ref : true
31
-
26
+ - name : Build the Docker image
27
+ run : docker build --tag
28
+ ${SERVICE_NAME}:latest --file
29
+ Dockerfile ./gsr-mirror
30
+ - name : GitHub Image Push
31
+ run : docker push $SERVICE_NAME:latest
32
32
You can’t perform that action at this time.
0 commit comments