From 18ed595a3064a14a490b4a76cd30b2b9389189e0 Mon Sep 17 00:00:00 2001 From: zhao jun <873019219@qq.com> Date: Mon, 30 Sep 2024 04:04:11 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e57b7ed..a868a4a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,14 +30,20 @@ jobs: uses: useblacksmith/setup-node@v5 with: node-version: '20' - cache: 'yarn' - cache-dependency-path: yarn.lock - name: Build front run: | npm install -g yarn yarn && yarn build + - name: Setup Node + # uses: actions/setup-node@v4 + uses: useblacksmith/setup-node@v5 + with: + node-version: '20' + cache: 'yarn' + cache-dependency-path: yarn.lock + - name: Set up QEMU # 设置 QEMU 环境,用来模拟操作系统,用来编译 arm64 镜像和 amd64 镜像 uses: docker/setup-qemu-action@v3 with: @@ -85,27 +91,8 @@ jobs: fi done - command="docker buildx build --platform linux/amd64,linux/arm64 --push . " + command="docker buildx build --provenance=false --platform linux/amd64,linux/arm64 --push . " for repo in ${repos[@]}; do - command="$command -t $repo\:latest -t $repo\:$(git rev-parse --short HEAD)" + command="$command -t $repo\:latest -t $repo\:$(date +%Y-%m-%d_%H-%M-%S)_$(git rev-parse --short HEAD)" done - echo "$command" - eval $command - - - name: executing remote ssh commands using ssh key - uses: appleboy/ssh-action@v1.0.3 - if: ${{ github.event.inputs.updateServerVersion == 'true' }} - with: - host: ${{ secrets.HOST }} - port: ${{ secrets.PORT }} - username: ${{ secrets.USERNAME }} - passphrase: ${{ secrets.PASSPHRASE }} - key: ${{ secrets.KEY }} - script: | - docker run --rm \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v ~/.docker/config.json:/config.json \ - containrrr/watchtower \ - --cleanup \ - --run-once \ - zfile-docs + eval $command \ No newline at end of file