diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index f7ed30f..d935d17 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -21,15 +21,16 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Build Docker image + run: docker build -t server . + - name: Log in to Docker Hub uses: docker/login-action@v2 + if: github.ref == 'refs/heads/master' with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build Docker image - run: docker build -t server . - - name: Push Docker image if: github.ref == 'refs/heads/master' run: docker push server:latest