Skip to content

Commit 4e96935

Browse files
committed
better ci pipeline
1 parent 3d7bc6a commit 4e96935

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/docker-image.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v3
17-
- name: Build the Docker image
17+
18+
- name: Vars
19+
id: vars
1820
run: |
19-
docker build . --file Dockerfile --tag ghcr.io/sampozki/botto:latest
21+
echo "SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-7)" >> $GITHUB_ENV
22+
23+
- name: Build image
24+
run: |
25+
docker build . --file Dockerfile \
26+
--tag ghcr.io/sampozki/botto:latest \
27+
--tag ghcr.io/sampozki/botto:${SHORT_SHA}
2028
docker images
2129
2230
- name: Log in to GitHub Container Registry
@@ -25,5 +33,8 @@ jobs:
2533
registry: ghcr.io
2634
username: ${{ github.actor }}
2735
password: ${{ secrets.TOKEN }}
28-
- name: Push the Docker image to GitHub Container Registry
29-
run: docker push ghcr.io/sampozki/botto:latest
36+
37+
- name: Push the image to ghcr
38+
run: |
39+
docker push ghcr.io/sampozki/botto:latest
40+
docker push ghcr.io/sampozki/botto:${SHORT_SHA}

0 commit comments

Comments
 (0)