44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
name: Deploy to UpYun
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # 根据您的实际情况修改分支名称
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Debug Environment Variables
|
|
run: |
|
|
echo "Bucket: ${{ secrets.UPYUN_BUCKET }}"
|
|
echo "Operator: ${{ secrets.UPYUN_OPERATOR }}"
|
|
# 不推荐打印密码,但可以确认是否为空字符串
|
|
if [ -z "${{ secrets.UPYUN_PASSWORD }}" ]; then
|
|
echo "Password is empty or not set"
|
|
else
|
|
echo "Password is set"
|
|
fi
|
|
|
|
- name: Install upx-cli
|
|
run: |
|
|
curl -s https://packagecloud.io/install/repositories/upyun/upx/script.deb.sh | sudo bash
|
|
sudo apt-get install upx
|
|
|
|
- name: Delete files in UpYun bucket
|
|
run: |
|
|
upx rm -r /${{ secrets.UPYUN_BUCKET }}/ --user ${{ secrets.UPYUN_OPERATOR }} --password ${{ secrets.UPYUN_PASSWORD }}
|
|
|
|
- name: Deploy to UpYun
|
|
uses: her-cat/upyun-deployer@v1.0.3
|
|
with:
|
|
bucket: ${{ secrets.UPYUN_BUCKET }}
|
|
operator: ${{ secrets.UPYUN_OPERATOR }}
|
|
password: ${{ secrets.UPYUN_PASSWORD }}
|
|
dir: 'public' # 确认这个目录是您的构建输出目录
|
|
publish_dir: '/' # 确认这个是您想要刷新的目录
|