50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: Deploy to UpYun
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Hugo
|
|
uses: peaceiris/actions-hugo@v2
|
|
with:
|
|
hugo-version: '0.128.2'
|
|
extended: true
|
|
|
|
- name: Build static files
|
|
run: hugo --minify --environment production
|
|
|
|
- name: Check build output directory
|
|
run: ls -la public
|
|
|
|
- name: Debugging: List all files in workspace
|
|
run: |
|
|
echo "Listing all files in the workspace directory"
|
|
ls -la /github/workspace
|
|
|
|
- name: Check if public directory exists
|
|
run: |
|
|
if [ -d "/github/workspace/public" ]; then
|
|
echo "Public directory exists"
|
|
else
|
|
echo "Public directory does not exist"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Deploy to UpYun
|
|
uses: her-cat/upyun-deployer@v1.0.3
|
|
with:
|
|
bucket: ${{ secrets.UPYUN_BUCKET }}
|
|
operator: ${{ secrets.UPYUN_OPERATOR_NAME }}
|
|
password: ${{ secrets.UPYUN_OPERATOR_PWD }}
|
|
dir: 'public'
|