|
9 | 9 | - current
|
10 | 10 | - rc
|
11 | 11 |
|
12 |
| -deploy-release: |
| 12 | +.deploy: &deploy |
13 | 13 | tags:
|
14 | 14 | - esphomedocs
|
15 | 15 | before_script:
|
16 | 16 | - mkdir -p /root/.ssh
|
17 |
| - - echo "$GITHUB_PRIVATE_KEY" | tr -d '\r' >/root/.ssh/id_rsa |
| 17 | + - echo "$PRIVATE_KEY" | tr -d '\r' >/root/.ssh/id_rsa |
18 | 18 | - chmod 600 /root/.ssh/id_rsa
|
19 | 19 | - ssh-keyscan -t rsa github.com >>/root/.ssh/known_hosts
|
20 | 20 | - git config --global user.email "$GITHUB_EMAIL"
|
21 | 21 | - git config --global user.name "$GITHUB_NAME"
|
22 | 22 | - git worktree prune
|
23 |
| - - rm -rf ../esphomelib |
| 23 | + - rm -rf ../esphomelib _build/html/ |
24 | 24 | script:
|
25 |
| - - git fetch --force git@github.com:OttoWinter/esphomedocs.git gh-pages:gh-pages |
| 25 | + - mkdir -p _build/html |
| 26 | + - git fetch --force git@github.com:${TARGET_REPO}.git gh-pages:gh-pages |
26 | 27 | - git worktree add _build/html gh-pages
|
27 | 28 | - make ../esphomelib
|
28 |
| - - make deploy |
29 |
| - - git -C _build/html push git@github.com:OttoWinter/esphomedocs.git gh-pages |
| 29 | + - touch _build/html/.nojekyll |
| 30 | + - echo ${CNAME} >_build/html/CNAME |
| 31 | + - make html |
| 32 | + - git -C _build/html add --all |
| 33 | + - git -C _build/html commit -m "Deploy to gh-pages" |
| 34 | + - git -C _build/html push -f git@github.com:${TARGET_REPO}.git gh-pages |
| 35 | + |
| 36 | +deploy-release: |
| 37 | + <<: *deploy |
| 38 | + variables: |
| 39 | + TARGET_REPO: OttoWinter/esphomedocs |
| 40 | + PRIVATE_KEY: ${GITHUB_PRIVATE_KEY} |
| 41 | + CNAME: esphomelib.com |
30 | 42 | only:
|
31 | 43 | - current
|
32 | 44 |
|
33 |
| - |
34 | 45 | deploy-beta:
|
35 |
| - tags: |
36 |
| - - esphomedocs |
37 |
| - before_script: |
38 |
| - - mkdir -p /root/.ssh |
39 |
| - - echo "$GITHUB_BETA_PRIVATE_KEY" | tr -d '\r' >/root/.ssh/id_rsa |
40 |
| - - chmod 600 /root/.ssh/id_rsa |
41 |
| - - ssh-keyscan -t rsa github.com >>/root/.ssh/known_hosts |
42 |
| - - git config --global user.email "$GITHUB_EMAIL" |
43 |
| - - git config --global user.name "$GITHUB_NAME" |
44 |
| - - git worktree prune |
45 |
| - - rm -rf ../esphomelib |
46 |
| - script: |
47 |
| - - git fetch --force git@github.com:OttoWinter/beta.esphomelib.com.git master:gh-pages |
48 |
| - - git worktree add _build/html gh-pages |
49 |
| - - make ../esphomelib |
50 |
| - - make deploy |
51 |
| - - git -C _build/html push git@github.com:OttoWinter/beta.esphomelib.com.git gh-pages |
| 46 | + <<: *deploy |
| 47 | + variables: |
| 48 | + TARGET_REPO: OttoWinter/esphomedocs-beta |
| 49 | + PRIVATE_KEY: ${GITHUB_BETA_PRIVATE_KEY} |
| 50 | + CNAME: beta.esphomelib.com |
52 | 51 | only:
|
53 | 52 | - rc
|
0 commit comments