Skip to content

Commit

Permalink
chore:设置 deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazi7 committed Oct 21, 2024
1 parent f915a94 commit f382f37
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- main

env:
env.REGISTRY:

jobs:
build-and-deploy:
Expand All @@ -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
push: true
tags: lihazi/weilai:latest

0 comments on commit f382f37

Please sign in to comment.