Skip to content

Commit 5955df6

Browse files
author
pptfz
committed
更新ssh笔记
0 parents  commit 5955df6

610 files changed

Lines changed: 188396 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
jobs:
11+
build:
12+
name: Build Docusaurus
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 18
21+
cache: npm
22+
23+
# - name: Install dependencies
24+
# run: yarn install --frozen-lockfile
25+
# - name: Build website
26+
# run: yarn build
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build website
32+
env:
33+
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
34+
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
35+
ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }}
36+
run: npm run build
37+
38+
- name: Upload Build Artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: build
42+
43+
- name: Extract commit message
44+
id: extract_commit_message
45+
run: echo "COMMIT_MSG=$(git log -1 --pretty=%B | tr -d '\n')" >> $GITHUB_ENV
46+
47+
- name: Send notification on success
48+
if: success()
49+
env:
50+
WEBHOOK_KEY: ${{ secrets.WECHAT_WEBHOOK_KEY }}
51+
COMMIT_MSG: ${{ env.COMMIT_MSG }}
52+
run: |
53+
TIMESTAMP=$(TZ=Asia/Shanghai date "+%Y-%m-%d %H:%M:%S")
54+
curl -X POST -H 'Content-Type: application/json' \
55+
-d '{
56+
"msgtype": "markdown",
57+
"markdown": {
58+
"content": "**发布结果通知**\n\n申请标题: '"${COMMIT_MSG}"'\n\n应用名称: docusaurus\n\n应用版本: master#${{ github.sha }}\n\n执行人员: Webhook\n\n发布结果: <font color=\"info\">成功</font>\n\n发布时间: '"${TIMESTAMP}"'\n\n> 来自 GitHub Actions"
59+
}
60+
}' \
61+
https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${WEBHOOK_KEY}
62+
63+
- name: Send failure notification
64+
if: failure()
65+
env:
66+
WEBHOOK_KEY: ${{ secrets.WECHAT_WEBHOOK_KEY }}
67+
COMMIT_MSG: ${{ env.COMMIT_MSG }}
68+
run: |
69+
TIMESTAMP=$(TZ=Asia/Shanghai date "+%Y-%m-%d %H:%M:%S")
70+
curl -X POST -H 'Content-Type: application/json' \
71+
-d '{
72+
"msgtype": "markdown",
73+
"markdown": {
74+
"content": "**发布结果通知**\n\n申请标题: '"${COMMIT_MSG}"'\n\n应用名称: docusaurus\n\n应用版本: master#${{ github.sha }}\n\n执行人员: Webhook\n\n发布结果: <font color=\"waring\">失败</font>\n\n发布时间: '"${TIMESTAMP}"'\n\n> 来自 GitHub Actions"
75+
}
76+
}' \
77+
https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${WEBHOOK_KEY}
78+
79+
deploy:
80+
name: Deploy to GitHub Pages
81+
needs: build
82+
83+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
84+
permissions:
85+
pages: write # to deploy to Pages
86+
id-token: write # to verify the deployment originates from an appropriate source
87+
88+
# Deploy to the github-pages environment
89+
environment:
90+
name: github-pages
91+
url: ${{ steps.deployment.outputs.page_url }}
92+
93+
runs-on: ubuntu-latest
94+
steps:
95+
- name: Deploy to GitHub Pages
96+
id: deployment
97+
uses: actions/deploy-pages@v4
98+
99+

.github/workflows/test-deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
jobs:
11+
test-deploy:
12+
name: Test deployment
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 18
21+
cache: npm
22+
23+
# - name: Install dependencies
24+
# run: yarn install --frozen-lockfile
25+
# - name: Test build website
26+
# run: yarn build
27+
- name: Install dependencies
28+
run: npm ci
29+
- name: Test build website
30+
run: npm run build

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
22+
.env

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 🙁 ➕ 🎮 ➕ 🍺 ➕ 🎱 ➕ 👙 🟰 😍
2+
3+
4+
5+
![dance-straps2](https://raw.githubusercontent.com/pptfz/picgo-images/master/img/dance-straps2.gif) ![readme](https://raw.githubusercontent.com/pptfz/picgo-images/master/img/readme.gif) ![dance-straps1](https://raw.githubusercontent.com/pptfz/picgo-images/master/img/dance-straps1.gif)
6+
7+
8+
9+
10+
11+
![iShot2020-10-28_15.06.18](https://raw.githubusercontent.com/pptfz/picgo-images/master/img/iShot2020-10-28_15.06.18.png)
12+

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

0 commit comments

Comments
 (0)