-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.bat
45 lines (34 loc) · 965 Bytes
/
deploy.bat
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
@echo off
setlocal enabledelayedexpansion
::Install all production modules
echo Installing all production modules...
call npm ci --only=production
::Create .nojekyll
echo Ensuring .nojekyll...
if not exist .nojekyll (
copy nul .nojekyll >nul || goto :error
)
::Delete .gitignore
echo Deleting .gitignore...
if exist .gitignore (
del /f /q /s .gitignore >nul || goto :error
)
::Commit and push
echo Staging files...
git add . || goto :error
echo Committing...
git commit --allow-empty-message --no-edit || goto :error
echo Pushing...
git push -f origin main:gh-pages || goto :error
::Reset one commit back
echo Resetting to previous commit...
git reset --hard HEAD~ || goto :error
::Resetting dependencies
echo Resetting dependencies...
call npm ci || goto :error
endlocal
exit /b
:error
exit /b %errorlevel%
:eof
exit /b