Skip to content

Commit

Permalink
更新 actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaojun1998 committed Sep 30, 2024
1 parent 4fdc3f6 commit 18ed595
Showing 1 changed file with 11 additions and 24 deletions.
35 changes: 11 additions & 24 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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/[email protected]
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

0 comments on commit 18ed595

Please sign in to comment.