Skip to content

Commit

Permalink
[feat](ci) update ssh ci and assets path
Browse files Browse the repository at this point in the history
  • Loading branch information
miyuesc committed Mar 14, 2024
1 parent 2466a88 commit 9c4d281
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 13 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,59 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Install dependencies
run: pnpm install

- name: Build with VitePress
run: pnpm run book:build

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: book/online-book/.vitepress/dist

- name: Deploy 🚀
uses: cross-the-world/scp-pipeline@master
env:
WELCOME: "ssh scp ssh pipelines"
LASTSSH: "Doing something after copying"
with:
host: ${{ secrets.DR_HOST }}
user: ${{ secrets.DR_USER }}
pass: ${{ secrets.DR_PASS }}
port: ${{ secrets.DR_PORT }}
connect_timeout: 10s
local: './book/online-book/.vitepress/dist/*'
remote: /web-site/main

deploy:
runs-on: ubuntu-latest
needs: build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
> **Fork `chibivue` from [ubugeeei/chibivue](https://github.com/Ubugeeei/chibivue)**
<p align="center">
<img src="./book/images/logo/chibivue-img.png" width="600">
<img src="./chibivue-img.png" width="600">
</p>

<div align="center">
Expand Down
13 changes: 3 additions & 10 deletions book/online-book/.vitepress/config/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ export const sharedConfig = defineConfig({
srcDir: 'src',
srcExclude: ['__wip'],
head: [
[
'link',
{
rel: 'icon',
href: 'https://github.com/Ubugeeei/chibivue/blob/main/book/images/logo/logo.png?raw=true',
},
],
['link', { rel: 'icon', href: './logo.png?raw=true' }],

// source og
['meta', { property: 'source_og:site_name', content: 'chibivue' }],
Expand All @@ -38,8 +32,7 @@ export const sharedConfig = defineConfig({
'meta',
{
property: 'source_og:image',
content:
'https://github.com/Ubugeeei/chibivue/blob/main/book/images/logo/chibivue-img.png?raw=true',
content: './chibivue-img.png?raw=true',
},
],
['meta', { property: 'source_og:image:alt', content: 'chibivue' }],
Expand All @@ -66,7 +59,7 @@ export const sharedConfig = defineConfig({
],
],
themeConfig: {
logo: 'https://github.com/Ubugeeei/chibivue/blob/main/book/images/logo/logo.png?raw=true',
logo: './logo.png?raw=true',
search: { provider: 'local' },
outline: 'deep',
socialLinks: [
Expand Down
4 changes: 2 additions & 2 deletions book/online-book/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ layout: home

hero:
name: "chibivue"
text: "一步一步,从一行 \"Hello, World\" 开始"
text: "一步一步,从一行 \"Hello, World\" 开始实现 MiniVue"
tagline: 由 VitePress 构建
image: https://github.com/Ubugeeei/chibivue/blob/main/book/images/logo/logo.png?raw=true
image: ./logo.png?raw=true
actions:
- theme: brand
text: 深入本书 ->
Expand Down
Binary file added book/online-book/src/public/chibivue-img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added book/online-book/src/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9c4d281

Please sign in to comment.