Skip to content

Commit

Permalink
fix: deploy-do-web issue with secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
hussedev committed Aug 8, 2024
1 parent 8a85167 commit 3f8ea8a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/deploy-do-web.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Deploy DO Web

on: workflow_dispatch
on:
pull_request:
branches:
- main

env:
FILENAME: Dockerfile.web
Expand All @@ -17,8 +20,10 @@ jobs:
- name: Build the Docker image
run: docker build -f "$FILENAME" -t "$IMAGE_NAME:$IMAGE_TAG" . # build the Docker image using envs defined above

# login to dockerhub then push the image to the dockerhub repo
- name: Push Docker image
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }}
run: |-
echo ${{secrets.DOCKERHUB_PASS}} | docker login -u ${{secrets.DOCKERHUB_USER}} --password-stdin
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin
docker push "$IMAGE_NAME:$IMAGE_TAG"

0 comments on commit 3f8ea8a

Please sign in to comment.