个人网站架构V3

image-20210110160439663

之前的基础上做了些改进

Update

static page

oss 开启版本控制(之前开启静态页面的bucket不支持版本控制)

image-20210110163547121

blog

这个模块的变化比较大,从原来的docker迁移到aliyun oss,编译&部署依赖github actions完成,整个过程非常自动化.只要commit就会自动部署,进一步降低本地系统的依赖

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# deploy hexo blog to aliyun oss

name: Deploy Blog

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [master]
pull_request:
branches: [master]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: "12"

# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!

- name: Install dependencies
run: |
npm i -g hexo-cli
npm i
hexo
- name: Run a multi-line script
run: |
hexo generate
ls -l public
- name: config ossutil
uses: manyuanrong/setup-ossutil@v2.0
with:
endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }}
access-key-id: ${{ secrets.ALIYUN_OSS_KEY_ID }}
access-key-secret: ${{ secrets.ALIYUN_OSS_KEY_SECRET }}

- name: upload to oss
run: |
ossutil rm oss://chengchaoblog/ -a -r -f
ossutil cp public oss://chengchaoblog -r -f