Skip to content

Commit 3f3afe2

Browse files
committed
chore: update workflows and index page
1 parent b83c88f commit 3f3afe2

File tree

6 files changed

+65
-46
lines changed

6 files changed

+65
-46
lines changed

.github/workflows/branch-merge.yml

-17
This file was deleted.

.github/workflows/compress.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Compress
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "**.jpg"
8+
- "**.jpeg"
9+
- "**.png"
10+
- "**.webp"
11+
workflow_dispatch:
12+
13+
jobs:
14+
compress:
15+
runs-on: ubuntu-latest
16+
if: github.repository == 'doocs/coding-interview'
17+
steps:
18+
- name: Checkout Branch
19+
uses: actions/checkout@v2
20+
21+
- name: Compress Images
22+
id: calibre
23+
uses: calibreapp/image-actions@main
24+
with:
25+
githubToken: ${{ secrets.ACTION_TOKEN }}
26+
compressOnly: true
27+
28+
- name: Commit Files
29+
if: |
30+
steps.calibre.outputs.markdown != ''
31+
run: |
32+
git config --local user.email "[email protected]"
33+
git config --local user.name "yanglbme"
34+
git commit -m "chore: auto compress images" -a
35+
36+
- name: Push Changes
37+
if: |
38+
steps.calibre.outputs.markdown != ''
39+
uses: ad-m/github-push-action@master
40+
with:
41+
github_token: ${{ secrets.ACTION_TOKEN }}

.github/workflows/prettier.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- main
7+
- main
88

99
jobs:
1010
prettier:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v2
16-
with:
17-
ref: ${{ github.head_ref }}
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
with:
17+
ref: ${{ github.head_ref }}
1818

19-
- name: Prettify code
20-
uses: creyD/[email protected]
21-
with:
22-
prettier_options: --write **/*.{md}
23-
commit_message: 'style: prettify code'
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Prettify code
20+
uses: creyD/[email protected]
21+
with:
22+
prettier_options: --write **/*.{md}
23+
commit_message: "style: prettify code"
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sync.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ name: Sync
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66

77
jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
13-
- name: Sync to Gitee
14-
uses: wearerequired/git-mirror-action@master
15-
env:
11+
- uses: actions/checkout@v2
12+
13+
- name: Sync to Gitee
14+
uses: wearerequired/git-mirror-action@master
15+
env:
1616
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
17-
with:
17+
with:
1818
source-repo: [email protected]:doocs/coding-interview.git
1919
destination-repo: [email protected]:Doocs/coding-interview.git
2020

21-
- name: Build Gitee Pages
22-
uses: yanglbme/gitee-pages-action@main
23-
with:
21+
- name: Build Gitee Pages
22+
uses: yanglbme/gitee-pages-action@main
23+
with:
2424
gitee-username: yanglbme
2525
gitee-password: ${{ secrets.GITEE_PASSWORD }}
2626
gitee-repo: doocs/coding-interview

docs/effective-java.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# 《Effective Java》
22

3-
[电子书下载](https://github.com/joyang1/JavaInterview/tree/master/books)
4-
53
## 第二章 创建和销毁对象
64

75
### 第 1 条:考虑用静态工厂方法代替构造器

index.html

+2-5
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,8 @@
9999
});
100100

101101
hook.afterEach(function (html) {
102-
const footer = [
103-
"<footer>",
104-
'<span>Copyright © 2018-2021 <a href="https://github.com/doocs" target="_blank">Doocs</a>. All rights reserved.',
105-
"</footer>",
106-
].join("");
102+
const currentYear = new Date().getFullYear()
103+
const footer = `<footer><span>Copyright © 2018-${currentYear} <a href="https://github.com/doocs" target="_blank">Doocs</a>. All Rights Reserved.</footer>`
107104
return html + footer;
108105
});
109106
},

0 commit comments

Comments
 (0)