From eb9d88ac33b9c5836d95b8be25a85655788a292a Mon Sep 17 00:00:00 2001 From: jackjieYYY <53422254+jackjieYYY@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:53:13 +0000 Subject: [PATCH] . --- .github/workflows/autoDeploy.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/autoDeploy.yml b/.github/workflows/autoDeploy.yml index 0a50d29..d7bf3e0 100644 --- a/.github/workflows/autoDeploy.yml +++ b/.github/workflows/autoDeploy.yml @@ -24,12 +24,15 @@ jobs: - name: Build run: npm run build + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push Docker image - run: | - echo ${{ secrets.DOCKER_HUB_USERNAME }} | docker login --username $DOCKER_HUB_USERNAME --password-stdin - docker build -t closure-front . - docker tag closure-front $DOCKER_HUB_USERNAME/closure-front:latest - docker push $DOCKER_HUB_USERNAME/closure-front:latest - env: - DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} - DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + file: ./Dockerfile + push: true \ No newline at end of file