|
1 | 1 | language: nix
|
2 |
| -branches: |
3 |
| - only: |
4 |
| - - master |
5 |
| - - production |
6 |
| - |
7 |
| -before_install: |
8 |
| -- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then |
9 |
| - openssl aes-256-cbc -K $encrypted_88bda2ae685f_key -iv $encrypted_88bda2ae685f_iv -in deploy_rsa.enc -out deploy_rsa -d; |
10 |
| - eval "$(ssh-agent -s)"; |
11 |
| - chmod 600 $TRAVIS_BUILD_DIR/deploy_rsa; |
12 |
| - ssh-add $TRAVIS_BUILD_DIR/deploy_rsa; |
13 |
| - fi |
14 | 2 |
|
15 | 3 | script:
|
16 |
| -- if [ "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_BRANCH" = "master" ]; then |
17 |
| - echo "SITEURL = 'http://weekly.nixos.org'" >> pelicanconf.py; |
18 |
| - echo "WITH_FUTURE_DATES = True" >> pelicanconf.py; |
19 |
| - fi |
20 | 4 | - nix-build -Q default.nix;
|
21 | 5 |
|
22 |
| -after_success: |
23 |
| -- env |
24 |
| -- git clone git@github.com:NixOS/nixos-weekly.git gh-pages -b gh-pages |
25 |
| -- if [ "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_BRANCH" = "master" ]; then |
26 |
| - mkdir -p gh-pages/preview; |
27 |
| - rm -rf gh-pages/preview/*; |
28 |
| - cp -RL result/* gh-pages/preview/; |
29 |
| - cd gh-pages; |
30 |
| - git add .; |
31 |
| - if [[ -n `git diff --cached --exit-code` ]]; then |
32 |
| - echo "= git status ============================================="; |
33 |
| - git status; |
34 |
| - echo "= git commit ============================================="; |
35 |
| - git config user.name 'NixOS Weekly Robot'; |
36 |
| - git config user.email 'weekly@nixos.org'; |
37 |
| - git commit -a -m "Preview of '$TRAVIS_COMMIT' commit built by Travis-CI \\#$((TRAVIS_JOB_ID - 1))"; |
38 |
| - git push git@github.com:NixOS/nixos-weekly.git HEAD:gh-pages; |
39 |
| - else |
40 |
| - echo "=========================================================="; |
41 |
| - echo "No changes. Nothing to commit"; |
42 |
| - echo "=========================================================="; |
43 |
| - fi |
44 |
| - fi; |
45 |
| -- if [ "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_BRANCH" = "production" ]; then |
46 |
| - mv gh-pages/preview tmp-preview; |
47 |
| - mv gh-pages/CNAME tmp-CNAME; |
48 |
| - rm -rf gh-pages/*; |
49 |
| - cp -RL result/* gh-pages/; |
50 |
| - mv tmp-preview gh-pages/preview; |
51 |
| - mv tmp-CNAME gh-pages/CNAME; |
52 |
| - cd gh-pages; |
53 |
| - touch .nojekyll; |
54 |
| - git add .; |
55 |
| - if [[ -n `git diff --cached --exit-code` ]]; then |
56 |
| - echo "= git status ============================================="; |
57 |
| - git status; |
58 |
| - echo "= git commit ============================================="; |
59 |
| - git config user.name "NixOS Weekly Robot"; |
60 |
| - git config user.email "weekly@nixos.org"; |
61 |
| - git commit -a -m "Release of $TRAVIS_TAG (commit '$TRAVIS_COMMIT') built by Travis-CI \\#$((TRAVIS_JOB_ID - 1))"; |
62 |
| - git push git@github.com:NixOS/nixos-weekly.git HEAD:gh-pages; |
63 |
| - else |
64 |
| - echo "=========================================================="; |
65 |
| - echo "No changes. Nothing to commit"; |
66 |
| - echo "=========================================================="; |
67 |
| - fi |
68 |
| - fi; |
0 commit comments