update action

This commit is contained in:
ClasWen 2024-09-22 19:53:14 +08:00
parent 78960ceb57
commit 2e17ae669f

View file

@ -2,7 +2,7 @@ name: build-deploy
on: on:
push: push:
branches: ["main"] branches: ["main", "feature-*"]
paths-ignore: # 忽略的文件 paths-ignore: # 忽略的文件
- "README.md" - "README.md"
- "LICENSE" - "LICENSE"
@ -40,15 +40,16 @@ jobs:
push: true push: true
platforms: linux/amd64 platforms: linux/amd64
tags: | tags: |
${{ env.IMAGE_NAME_FULL }}:latest ${{ env.IMAGE_NAME_FULL }}:${{ github.ref_name }}
- name: ssh pipelines - name: ssh pipelines
uses: appleboy/ssh-action@v1.0.0 uses: appleboy/ssh-action@v1.0.0
env:
BRANCH_NAME: ${{ github.ref_name }}
with: with:
host: ${{ secrets.REMOTE_HOST }} host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }} username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.ACCESS_TOKEN }} key: ${{ secrets.ACCESS_TOKEN }}
script: | script: |
printenv cd ${{ github.ref == 'refs/heads/main' && secrets.REMOTE_PATH || secrets.REMOTE_PATH_DEVELOPMENT }}
cd ${{ secrets.REMOTE_PATH }}
docker compose up --force-recreate -d docker compose up --force-recreate -d