Skip to content

Commit 9fece9a

Browse files
add loging and build-push to steps
1 parent 23a06a5 commit 9fece9a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/docker-image.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,21 @@ on:
88

99
jobs:
1010

11-
login:
11+
build:
12+
1213
runs-on: ubuntu-latest
14+
1315
steps:
1416
- name: Login to Docker Hub
1517
uses: docker/login-action@v3
1618
with:
1719
username: ${{ secrets.DOCKER_USER }}
1820
password: ${{ secrets.DOCKER_PASSWORD }}
1921

20-
build:
21-
22-
runs-on: ubuntu-latest
22+
- name: Build and push
23+
uses: docker/build-push-action@v6
24+
with:
25+
push: true
26+
tags: fastapi-redis-tut:$GITHUB_SHA
2327

24-
steps:
25-
- uses: actions/checkout@v4
26-
- name: Build the Docker image
27-
run: docker build . --file Dockerfile --tag fastapi-redis-tut:$(date +%s) &&
28-
// docker push fastapi-redis-tut:$(date +%s)
2928

0 commit comments

Comments
 (0)