Skip to content

Commit

Permalink
Updated git workflow attempt to fix error in push to docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiahuita committed Apr 30, 2024
1 parent 612217d commit bd450aa
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/webApp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ jobs:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Push Web Application to Docker Hub
- name: Checkout Code
uses: actions/checkout@v2

- name: Build and Push Docker Image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
docker build -t web-app .
docker tag web-app ${{ secrets.DOCKER_USERNAME }}/web-app:latest
docker push ${{ secrets.DOCKER_USERNAME }}/web-app:latest
docker build -t your-docker-hub-username/your-image-name:latest .
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push your-docker-hub-username/your-image-name:latest
deploy:
needs: push-to-docker-hub
Expand Down

0 comments on commit bd450aa

Please sign in to comment.