mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-16 20:27:08 +03:00
github: switch to action from travis (#153)
This commit is contained in:
29
.github/workflows/website.yml
vendored
Normal file
29
.github/workflows/website.yml
vendored
Normal file
@@ -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
.travis.yml
18
.travis.yml
@@ -1,18 +0,0 @@
|
||||
services:
|
||||
- docker
|
||||
|
||||
before_install:
|
||||
- openssl aes-256-cbc -K $encrypted_9157553ce13c_key -iv $encrypted_9157553ce13c_iv -in .travis/travis.enc -out ~/.ssh/id_rsa -d
|
||||
- chmod 600 ~/.ssh/id_rsa
|
||||
- git config --global user.name "Changkun Ou"
|
||||
- git config --global user.email "hi@changkun.us"
|
||||
|
||||
addons:
|
||||
ssh_known_hosts:
|
||||
- changkun.de
|
||||
|
||||
script:
|
||||
- make build
|
||||
|
||||
after_success:
|
||||
scp -r website/public/modern-cpp/* $encrypted_server_user@changkun.de:$encrypted_server_path
|
||||
Binary file not shown.
7
Makefile
7
Makefile
@@ -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)
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user