Specify the environment when generating site:

```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -17,7 +17,7 @@ jobs:
       - run:
           name: "Run Hugo"
           working_directory: /root/project/
-          command: HUGO_ENV=production hugo -v -s /root/project/
+          command: HUGO_ENV=staging hugo -v -s /root/project/

       - run:
           name: Change Amazon Links
@@ -47,4 +47,4 @@ jobs:
           name: Deploy
           command: |
             ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
-            rsync -e "ssh -p ${SSHPORT}" -az --delete public ${USER_NAME}@${HOST_NAME}:/var/www/test
+            rsync -e "ssh -p ${SSHPORT}" -az --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/test
```
This commit is contained in:
Kazuhiro MUSASHI 2019-05-04 21:30:02 +08:00
parent 685e10db5c
commit 0c6f2c8368
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ jobs:
- run: - run:
name: "Run Hugo" name: "Run Hugo"
working_directory: /root/project/ working_directory: /root/project/
command: HUGO_ENV=production hugo -v -s /root/project/ command: HUGO_ENV=staging hugo -v -s /root/project/
- run: - run:
name: Change Amazon Links name: Change Amazon Links
@ -47,4 +47,4 @@ jobs:
name: Deploy name: Deploy
command: | command: |
ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*" ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
rsync -e "ssh -p ${SSHPORT}" -az --delete public ${USER_NAME}@${HOST_NAME}:/var/www/test rsync -e "ssh -p ${SSHPORT}" -az --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/test