GeezerVison is showing github.com — github: switch to action from travis (#153) · xduooo/modern-cpp-tutorial@7ab24fe
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +29Lines changed: 29 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +name: Website |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + |
| 9 | + build: |
| 10 | + name: Website |
| 11 | + runs-on: ubuntu-latest |
| 12 | + timeout-minutes: 60 |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + - name: build |
| 16 | + env: |
| 17 | + USER: ${{ secrets.SERVER_USER }} |
| 18 | + TARGET: ${{ secrets.SERVER_PATH }} |
| 19 | + KEY: ${{ secrets.SERVER_KEY }} |
| 20 | + DOMAIN: ${{ secrets.SERVER_DOMAIN }} |
| 21 | + run: | |
| 22 | + make build |
| 23 | + mkdir ~/.ssh |
| 24 | + echo "$KEY" | tr -d '\r' > ~/.ssh/id_ed25519 |
| 25 | + chmod 400 ~/.ssh/id_ed25519 |
| 26 | + eval "$(ssh-agent -s)" |
| 27 | + ssh-add ~/.ssh/id_ed25519 |
| 28 | + ssh-keyscan -H $DOMAIN >> ~/.ssh/known_hosts |
| 29 | + scp -r website/public/modern-cpp/* $USER@$DOMAIN:$TARGET |
Collapse file
Copy file name to clipboardExpand all lines: .travis.yml -18Lines changed: 0 additions & 18 deletions Collapse file
Copy file name to clipboard Collapse file
Copy file name to clipboardExpand all lines: Makefile +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -DOCKER_ENV=changkun/modern-cpp-tutorial:build-env |
| 1 | +NAME=modern-cpp-tutorial |
| 2 | +DOCKER_ENV=changkun/$(NAME):build-env |
2 | 3 | TARGET = pdf epub |
3 | 4 | LANGS = zh-cn en-us |
4 | 5 | ALL_BUILDS = website $(TARGET) |
@@ -11,14 +12,14 @@ $(TARGET): $(LANGS) |
11 | 12 | mkdir -p website/public/modern-cpp/$@/ |
12 | 13 | for lang in $^ ; do \ |
13 | 14 | cd $@/$${lang} && make && make clean && cd ../..; \ |
14 | | - mv $@/$${lang}/modern-cpp-tutorial.$@ website/public/modern-cpp/$@/modern-cpp-tutorial-$${lang}.$@; \ |
| 15 | + mv $@/$${lang}/$(NAME).$@ website/public/modern-cpp/$@/$(NAME)-$${lang}.$@; \ |
15 | 16 | done |
16 | 17 |
|
17 | 18 | website: |
18 | 19 | cd website && make |
19 | 20 |
|
20 | 21 | build: |
21 | | - docker run --rm -v `pwd`:/modern-cpp-tutorial -it $(DOCKER_ENV) make |
| 22 | + docker run --rm -v `pwd`:/$(NAME) $(DOCKER_ENV) make |
22 | 23 |
|
23 | 24 | # dev |
24 | 25 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: docker/Dockerfile +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | FROM node:latest |
2 | 2 |
|
3 | | -LABEL "maintainer"="Changkun Ou <hi@changkun.us>" |
| 3 | +LABEL "maintainer"="Changkun Ou <hi[at]changkun.de>" |
4 | 4 | LABEL "repository"="https://github.com/changkun/modern-cpp-tutorial" |
5 | 5 | LABEL "homepage"="https://changkun.de/modern-cpp/" |
6 | 6 |
|
7 | | -# FUCKING UNICODE |
| 7 | +# For Unicode |
8 | 8 | ENV LANG C.UTF-8 |
9 | 9 | ENV LC_ALL C.UTF-8 |
10 | 10 |
|
|