Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ahemdboudarbala authored Aug 14, 2024
1 parent de90787 commit afde2a4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Log in to the Docker registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
- name: Push the Docker image to the registry
run: docker tag my-image-name:$(date +%s) my-docker-repo/my-image-name:latest
run: docker push my-docker-repo/my-image-name:latest

# Deployment job
deploy:
Expand All @@ -28,4 +33,7 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

- name: Pull and run the Docker image
run: |
docker pull my-docker-repo/my-image-name:latest
docker run -d -p 8090:8090 my-docker-repo/my-image-name:latest

0 comments on commit afde2a4

Please sign in to comment.