From afde2a452600fc17372f3feca41bb9af0b184aba Mon Sep 17 00:00:00 2001 From: boudarbalaahmed Date: Wed, 14 Aug 2024 10:32:28 +0100 Subject: [PATCH] Update docker-image.yml --- .github/workflows/docker-image.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index cb7cc6f..9b15501 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -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: @@ -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