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