-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml.bak
48 lines (42 loc) · 2.03 KB
/
appveyor.yml.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
clone_depth: 5
environment:
nodejs_version: "10"
npm_version: "6"
access_token:
secure: xRs4hVo6dCqfMht+4ilML7cg/5Gpeknh4GEKDqxVLL7WTx6N2fYjMr95HsRWWAva
install:
- ps: Install-Product node $env:nodejs_version
- node --version
- npm --version
- npm install hexo-cli -g
- npm install
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):[email protected]`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")
on_success:
- git config --global credential.helper store
- ps: Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):[email protected]`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
- git commit -m "Update Static Site"
- git push origin %TARGET_BRANCH%
- appveyor AddMessage "Static Site Updated"