diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 41e3a2c..089b565 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,9 +4,6 @@ on: push: branches: - main - -env: - env.REGISTRY: jobs: build-and-deploy: @@ -15,25 +12,18 @@ jobs: steps: - uses: actions/checkout@v4 - # 设置 Docker 构建器,以便构建 - - name: Set up Docker Buildx + - name: 设置 Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' + - name: 登录 Docker Hub uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push Docker image + - name: 构建 & 推送镜像 id: build-and-push uses: docker/build-push-action@v6 with: - context: . - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file + push: true + tags: lihazi/weilai:latest \ No newline at end of file