Fix deploy

This commit is contained in:
Otto Winter 2018-09-25 13:50:13 +02:00
parent a178e2fbe7
commit 9ae98f8742
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
3 changed files with 10 additions and 16 deletions

View File

@ -1,28 +1,29 @@
---
stages:
- build
- deploy
build:
stage: build
tags:
- esphomedocs
script:
- make html
except:
- current
deploy:
stage: deploy
tags:
- esphomedocs
before_script:
- mkdir -p /root/.ssh
- echo "$GITHUB_PRIVATE_KEY" | tr -d '\r' >/root/.ssh/id_rsa
- chmod 600 /root/.ssh/id_rsa
- ssh-keyscan -H git@github.com:OttoWinter/esphomedocs.git >>/root/.ssh/id_rsa
- ssh-keyscan -t rsa github.com >>/root/.ssh/known_hosts
- git config --global user.email "$GITHUB_EMAIL"
- git config --global user.name "$GITHUB_NAME"
- git worktree prune
- rm -rf ../esphomelib
script:
- git worktree add _build/html
- git fetch --force git@github.com:OttoWinter/esphomedocs.git gh-pages:gh-pages
- git worktree add _build/html gh-pages
- make deploy
- git -C _build/html push git@github.com:OttoWinter/esphomedocs.git:gh-pages
- git -C _build/html push git@github.com:OttoWinter/esphomedocs.git gh-pages
artifacts:
paths:
- _build/html

View File

@ -16,10 +16,6 @@ RUN pip3 install --no-cache-dir --no-binary :all: \
sphinx \
breathe
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash - && \
apt-get install -y nodejs && \
npm install -g html-minifier
VOLUME /data/esphomedocs
EXPOSE 8000
WORKDIR /data/esphomedocs

View File

@ -1,3 +0,0 @@
find _build/html/ -name "*.html" | while read html;do
html-minifier --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype "$html" -o "$html"
done