Skip to content

github: switch to action from travis #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Website

on:
push:
branches: [ master ]

jobs:

build:
name: Website
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- name: build
env:
USER: ${{ secrets.SERVER_USER }}
TARGET: ${{ secrets.SERVER_PATH }}
KEY: ${{ secrets.SERVER_KEY }}
DOMAIN: ${{ secrets.SERVER_DOMAIN }}
run: |
make build
mkdir ~/.ssh
echo "$KEY" | tr -d '\r' > ~/.ssh/id_ed25519
chmod 400 ~/.ssh/id_ed25519
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
ssh-keyscan -H $DOMAIN >> ~/.ssh/known_hosts
scp -r website/public/modern-cpp/* $USER@$DOMAIN:$TARGET
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

Binary file removed .travis/travis.enc
Binary file not shown.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DOCKER_ENV=changkun/modern-cpp-tutorial:build-env
NAME=modern-cpp-tutorial
DOCKER_ENV=changkun/$(NAME):build-env
TARGET = pdf epub
LANGS = zh-cn en-us
ALL_BUILDS = website $(TARGET)
Expand All @@ -11,14 +12,14 @@ $(TARGET): $(LANGS)
mkdir -p website/public/modern-cpp/$@/
for lang in $^ ; do \
cd $@/$${lang} && make && make clean && cd ../..; \
mv $@/$${lang}/modern-cpp-tutorial.$@ website/public/modern-cpp/$@/modern-cpp-tutorial-$${lang}.$@; \
mv $@/$${lang}/$(NAME).$@ website/public/modern-cpp/$@/$(NAME)-$${lang}.$@; \
done

website:
cd website && make

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

# dev

Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM node:latest

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

# FUCKING UNICODE
# For Unicode
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

Expand Down