Files
blog/.github/workflows/upy.yml
T
Workflow config file is invalid. Please check your config file: go-yaml load error in scanner at L9.C11: mapping values are not allowed in this context
2024-10-21 20:58:31 +08:00

50 lines
1.3 KiB
YAML

name: Deploy to UpYun
on:
push:
branches:
- main # 根据您的实际情况修改分支名称
schedule:
<<<<<<< HEAD
- cron: '0 */12 * * *' # 每十二小时自动构建一次
=======
- cron: '0 */12 * * *' # 每三小时自动构建一次
>>>>>>> b533295500100e41380a58ca463365f2b8e12cd5
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.128.2'
extended: true
- name: Build
run: rm -rf public && hugo --minify
- 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: 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: '/' # 发布到 UpYun 的根目录