diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 546f65b..466ad60 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: build-deploy +name: main on: push: @@ -19,9 +19,19 @@ jobs: build: runs-on: ubuntu-latest steps: - # 切换分支 - - name: Checkout - uses: actions/checkout@master + - name: Build container + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + no-cache: true + platforms: linux/amd64 + tags: | + ${{ env.IMAGE_NAME_FULL }}:${{ github.ref_name }} + + build-and-push: + runs-on: ubuntu-latest + steps: - name: Login DockerHub uses: docker/login-action@v2 @@ -31,12 +41,11 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push to DockerHub - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile no-cache: true - # target: deploy push: true platforms: linux/amd64 tags: |