使用appveyor构建可以自动部署我的博客的项目。我的博客源代码已部署在GitHub存储库中。当我使用Appveyor构建此项目时,会发生一些错误。
我已经检查了有关用户名和电子邮件的个人资料和环境,这是正确的。而且我在传送带环境中找不到密码配置文件!
以下是appveyor.yml的内容:
安全是对的,为了保护我的隐私,我没有显示
clone_depth: 5
environment:
access_token:
secure: ptnWH+BWFZ8LLx0mKP+YEYOBCz56B36sNBh/GBSethxcVGMhwXrU/A8W+MEFB+Q5
install:
- node --version
- npm --version
- npm install
- npm install hexo-cli -g
build_script:
- hexo generate
artifacts:
- path: public
on_success:
- git config --global credential.helper store
- ps: Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
- git config --global user.email "%GIT_USER_EMAIL%"
- git config --global user.name "%GIT_USER_NAME%"
- git clone --depth 5 -q --branch=%TARGET_BRANCH% %STATIC_SITE_REPO% %TEMP%\static-site
- cd %TEMP%\static-site
- del * /f /q
- for /d %%p IN (*) do rmdir "%%p" /s /q
- SETLOCAL EnableDelayedExpansion & robocopy "%APPVEYOR_BUILD_FOLDER%\public" "%TEMP%\static-site" /e & IF !ERRORLEVEL! EQU 1 (exit 0) ELSE (IF !ERRORLEVEL! EQU 3 (exit 0) ELSE (exit 1))
- git add -A
- if "%APPVEYOR_REPO_BRANCH%"=="master" if not defined APPVEYOR_PULL_REQUEST_NUMBER (git diff --quiet --exit-code --cached || git commit -m "Update Static Site" && git push origin %TARGET_BRANCH% && appveyor AddMessage "Static Site Updated")