Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Formartha authored Feb 26, 2024
1 parent f2289ee commit 4dcdc0e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Get Git commit SHA
id: git_sha
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)"

- name: Build the Docker image
run: |
docker build . --file Dockerfile --tag my-image-name:$(date +%s)
docker build . --file Dockerfile --tag formartha/ai1899:${{ steps.git_sha.outputs.sha }}
- name: Log into Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: Push Docker image to Docker Hub
run: |
docker tag my-image-name:$(date +%s) formartha/ai1899:latest
docker tag formartha/ai1899:${{ steps.git_sha.outputs.sha }} formartha/ai1899:latest
docker push formartha/ai1899:latest

0 comments on commit 4dcdc0e

Please sign in to comment.