This commit is contained in:
小赵同学 committed 2024-07-28 10:24:43 +08:00
commit ce14cc1a32
1 file changed
+20 -21
+20 -21
View File
@@ -1,35 +1,34 @@
name: Deploy to UpYun name: Deploy to UpYun
on: on:
workflow_dispatch: push:
branches:
- main # 根据您的实际情况修改分支名称
jobs: jobs:
build: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Repository master branch - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Hugo - name: Debug Environment Variables
uses: peaceiris/actions-hugo@v2 run: |
with: echo "Bucket: ${{ secrets.UPYUN_BUCKET }}"
hugo-version: 'latest' echo "Operator: ${{ secrets.UPYUN_OPERATOR }}"
extended: true # 不推荐打印密码,但可以确认是否为空字符串
if [ -z "${{ secrets.UPYUN_PASSWORD }}" ]; then
echo "Password is empty or not set"
else
echo "Password is set"
fi
- name: Build static files - name: Deploy to UpYun
run: hugo --minify --environment production
- name: Check build output
run: ls -la public
- name: List workspace contents
run: ls -la /github/workspace
- name: Deploy
uses: her-cat/upyun-deployer@v1.0.3 uses: her-cat/upyun-deployer@v1.0.3
with: with:
bucket: ${{ secrets.UPYUN_BUCKET }} bucket: ${{ secrets.UPYUN_BUCKET }}
operator: ${{ secrets.UPYUN_OPERATOR_NAME }} operator: ${{ secrets.UPYUN_OPERATOR }}
password: ${{ secrets.UPYUN_OPERATOR_PWD }} password: ${{ secrets.UPYUN_PASSWORD }}
dir: 'public' dir: 'public' # 确认这个目录是您的构建输出目录
publish_dir: '/'