Skip to content

Commit 7ab24fe

Browse files
authored
github: switch to action from travis (changkun#153)
1 parent 6629732 commit 7ab24fe

File tree

5 files changed

+35
-23
lines changed

5 files changed

+35
-23
lines changed

.github/workflows/website.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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

.travis.yml

-18
This file was deleted.

.travis/travis.enc

-1.64 KB
Binary file not shown.

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
DOCKER_ENV=changkun/modern-cpp-tutorial:build-env
1+
NAME=modern-cpp-tutorial
2+
DOCKER_ENV=changkun/$(NAME):build-env
23
TARGET = pdf epub
34
LANGS = zh-cn en-us
45
ALL_BUILDS = website $(TARGET)
@@ -11,14 +12,14 @@ $(TARGET): $(LANGS)
1112
mkdir -p website/public/modern-cpp/$@/
1213
for lang in $^ ; do \
1314
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}.$@; \
1516
done
1617

1718
website:
1819
cd website && make
1920

2021
build:
21-
docker run --rm -v `pwd`:/modern-cpp-tutorial -it $(DOCKER_ENV) make
22+
docker run --rm -v `pwd`:/$(NAME) $(DOCKER_ENV) make
2223

2324
# dev
2425

docker/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM node:latest
22

3-
LABEL "maintainer"="Changkun Ou <hi@changkun.us>"
3+
LABEL "maintainer"="Changkun Ou <hi[at]changkun.de>"
44
LABEL "repository"="https://github.com/changkun/modern-cpp-tutorial"
55
LABEL "homepage"="https://changkun.de/modern-cpp/"
66

7-
# FUCKING UNICODE
7+
# For Unicode
88
ENV LANG C.UTF-8
99
ENV LC_ALL C.UTF-8
1010

0 commit comments

Comments
 (0)