Skip to content

Commit 356e82e

Browse files
committed
[migrate] replace Travis CI with GitHub actions
[optimize] add Yarn lock for cache [optimize] update Upstream packages
1 parent 80b0b33 commit 356e82e

File tree

9 files changed

+4169
-48
lines changed

9 files changed

+4169
-48
lines changed

.github/workflows/main.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI & CD
2+
on:
3+
push:
4+
branches:
5+
- hexo
6+
jobs:
7+
Build-and-Deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
with:
13+
submodules: recursive
14+
- name: Use Node.js
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: 14
18+
cache: yarn
19+
- name: Install & build
20+
run: yarn && yarn build
21+
- name: Deploy
22+
uses: peaceiris/actions-gh-pages@v3
23+
with:
24+
publish_dir: ./public
25+
cname: fcc-cd.dev
26+
publish_branch: master
27+
personal_token: ${{ secrets.GITHUB_TOKEN }}
28+
force_orphan: true

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm test

.husky/pre-push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm run build

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

ReadMe.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# freeCodeCamp 成都社区 官方网站
22

3-
Project generated by [create-hexo-wiki](https://tech-query.me/create-hexo-wiki/)
3+
Project generated by [create-hexo-wiki][1]
44

5-
[![NPM Dependency](https://david-dm.org/FreeCodeCamp-Chengdu/FreeCodeCamp-Chengdu.github.io.svg)](https://david-dm.org/FreeCodeCamp-Chengdu/FreeCodeCamp-Chengdu.github.io)
6-
[![Build Status](https://travis-ci.com/FreeCodeCamp-Chengdu/FreeCodeCamp-Chengdu.github.io.svg?branch=hexo)](https://travis-ci.com/FreeCodeCamp-Chengdu/FreeCodeCamp-Chengdu.github.io)
7-
[![Anti 996 LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)
5+
[![NPM Dependency](https://david-dm.org/FreeCodeCamp-Chengdu/FreeCodeCamp-Chengdu.github.io.svg)][2]
6+
[![CI & CD](https://github.com/FreeCodeCamp-Chengdu/FreeCodeCamp-Chengdu.github.io/workflows/CI%20&%20CD/badge.svg)][3]
7+
[![Anti 996 LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)][4]
88

99
## 参与开发
1010

11-
请务必先做好[数据子库的准备](https://github.com/FreeCodeCamp-Chengdu/Wiki/#%E6%9C%AC%E6%9C%BA%E7%BC%96%E8%BE%91)
11+
请务必先做好[数据子库的准备][5]
1212

1313
### 安装
1414

@@ -100,3 +100,9 @@ git push
100100
### 特殊脚本
101101

102102
1. [Don't be evil !](themes/Icarus/layout/common/evil_alert.ejs)
103+
104+
[1]: https://tech-query.me/create-hexo-wiki/
105+
[2]: https://david-dm.org/FreeCodeCamp-Chengdu/FreeCodeCamp-Chengdu.github.io
106+
[3]: https://github.com/FreeCodeCamp-Chengdu/FreeCodeCamp-Chengdu.github.io/actions
107+
[4]: https://github.com/996icu/996.ICU/blob/master/LICENSE
108+
[5]: https://github.com/FreeCodeCamp-Chengdu/Wiki/#%E6%9C%AC%E6%9C%BA%E7%BC%96%E8%BE%91

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ feed:
9292
type: atom
9393
icon: images/FCC-CDC-v1-1.png
9494

95+
slidehtml:
96+
titleMerge: true
97+
9598
pwa:
9699
manifest:
97100
path: /manifest.json

package.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
"version": "4.2.1"
1414
},
1515
"dependencies": {
16-
"cheerio": "^1.0.0-rc.3",
16+
"cheerio": "1.0.0-rc.10",
1717
"hexo": "^4.2.1",
18-
"hexo-auto-category": "^0.2.0",
18+
"hexo-auto-category": "^0.2.1",
1919
"hexo-deployer-git": "^2.1.0",
2020
"hexo-generator-archive": "^1.0.0",
2121
"hexo-generator-category": "^1.0.0",
2222
"hexo-generator-feed": "^2.2.0",
2323
"hexo-generator-index": "^1.0.0",
2424
"hexo-generator-slidehtml": "0.0.62",
2525
"hexo-generator-tag": "^1.0.0",
26-
"hexo-migrator-web": "^1.0.3",
26+
"hexo-migrator-web": "^1.0.4",
2727
"hexo-permalink-pinyin": "^1.1.0",
2828
"hexo-prism-plugin": "^2.3.0",
2929
"hexo-reference": "^1.0.4",
@@ -34,20 +34,18 @@
3434
"icalendar": "^0.7.1",
3535
"object-assign": "^4.1.1"
3636
},
37+
"lint-staged": {
38+
"*.{html,md,css,less,js,json,yml,yaml}": "prettier --write"
39+
},
3740
"scripts": {
38-
"format": "prettier --write \"{,!(node_modules|.git|scaffolds|themes|public|.deploy_git)/**/}*.{html,md,css,less,js,json,yml,yaml}\"",
41+
"prepare": "husky install",
3942
"start": "hexo clean && hexo server",
40-
"deploy": "npm run format && hexo clean && hexo deploy",
41-
"build": "npm run format && hexo clean && hexo generate"
42-
},
43-
"husky": {
44-
"hooks": {
45-
"pre-commit": "npm run build && git add ."
46-
}
43+
"deploy": "hexo clean && hexo deploy",
44+
"build": "hexo clean && hexo generate"
4745
},
4846
"devDependencies": {
49-
"husky": "^4.3.0",
50-
"prettier": "^2.1.2"
47+
"husky": "^7.0.4",
48+
"prettier": "^2.5.1"
5149
},
5250
"prettier": {
5351
"trailingComma": "none",

0 commit comments

Comments
 (0)