deploy: use PAT secret, full pipeline
Deploy / build (push) Successful in 16s

This commit is contained in:
2026-09-06 05:02:37 +08:00
parent 9fafabecf2
commit 36acce550e
+15 -13
View File
@@ -4,23 +4,25 @@ on:
push:
branches: [main]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Debug env
run: |
echo "GITHUB_TOKEN length: ${#GITHUB_TOKEN}"
echo "GITHUB_SHA: ${GITHUB_SHA:-EMPTY}"
echo "GITHUB_SERVER_URL: ${GITHUB_SERVER_URL:-EMPTY}"
echo "GITHUB_REPOSITORY: ${GITHUB_REPOSITORY:-EMPTY}"
env | grep -i github | sort
- name: Checkout
run: |
git config --global --add safe.directory '*'
git clone --depth 1 "https://x-access-token:${GITHUB_TOKEN}@git.hoelee.com/hoelee/hoelee-blog.git" .
ls -la
git clone --depth 1 "https://hoelee:${{ secrets.PAT }}@git.hoelee.com/hoelee/hoelee-blog.git" .
git checkout $GITHUB_SHA 2>/dev/null || true
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Deploy to nginx-hoelee-blog
run: |
rm -rf /mnt/user/docker/nginx-hoelee-blog/html/*
cp -r dist/* /mnt/user/docker/nginx-hoelee-blog/html/
echo "Deployed. Contents:"
ls -la /mnt/user/docker/nginx-hoelee-blog/html/