Skip to content

Commit

Permalink
New changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ndahimana154 committed Oct 9, 2024
1 parent 04ee7fa commit a2740e0
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to Docker Hub
run: |
echo "${{ secrets.DOCKER_HUB_PASSWORD2 }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME2 }}" --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Check if Docker image exists
id: image-check
run: |
IMAGE_EXISTS=$(docker manifest inspect ${{ secrets.DOCKER_HUB_USERNAME2 }}/atlp-devpulse-bn:latest > /dev/null 2>&1 && echo true || echo false)
echo "Image exists: $IMAGE_EXISTS"
echo "::set-output name=exists::$IMAGE_EXISTS"
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME2 }}
password: ${{ secrets.DOCKER_HUB_PASSWORD2 }}

- name: Build and push Docker image (if not exists)
if: steps.image-check.outputs.exists == 'false'
- name: Build and push Docker image
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: ${{ secrets.DOCKER_HUB_USERNAME2 }}/atlp-devpulse-bn
Expand All @@ -50,6 +47,7 @@ jobs:
buildArgs: |
NODE_ENV=production
MONGO_PROD_DB=${{ secrets.MONGO_PROD_DB }}
context: .

- name: Deploy to DigitalOcean
uses: appleboy/ssh-action@v0.1.0
Expand Down

0 comments on commit a2740e0

Please sign in to comment.