Skip to content

Commit

Permalink
build: update github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
greyovo committed May 3, 2024
1 parent 74a7015 commit 8827640
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 2 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
#
name: Deploy PicQuery site to Pages

on:
push:
branches: [master]

# 允许你从 Actions 选项卡手动运行此工作流程
workflow_dispatch:

# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
concurrency:
group: pages
cancel-in-progress: false

jobs:
# 构建工作
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
# - uses: pnpm/action-setup@v3 # 如果使用 pnpm,请取消注释
# - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm # 或 pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci # 或 pnpm install / yarn install / bun install
- name: Build with VitePress
run: npm run docs:build # 或 pnpm docs:build / yarn docs:build / bun run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# 部署工作
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 5 additions & 0 deletions website/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///d%3A/Develop/Projects/Android/PicQuery/.github/workflows/deploy.yml"
}
}
3 changes: 2 additions & 1 deletion website/docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { defineConfig } from 'vitepress'
export default defineConfig({
title: "PicQuery",
description: "A PicQuery documentation site",
base: '/picquery/',
head: [
['link', { rel: 'icon', href: '/logo.webp' }],
],
themeConfig: {
logo: '/logo.webp',
logo: '/logo.png',
footer: {
message: 'Released under the MIT License, visit our <a href="/privacy-policy">Privacy Policy</a>.',
copyright: 'Copyright © 2023-present <a href="https://github.com/greyovo">Grey Liu</a>.',
Expand Down
34 changes: 33 additions & 1 deletion website/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ hero:
text: Github Release
link: https://github.com/greyovo/PicQuery/releases
image:
src: /screenshot.png
src: /logo.svg
alt: PicQuery app screenshot

features:
Expand All @@ -31,4 +31,36 @@ features:
details: Totally free, NO in-app purchases, supports both English and Chinese
---

<style>
:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #0078D7 30%, #41d1ff);

--vp-c-brand-1: rgb(33, 99, 150);
--vp-c-brand-2: rgba(0, 120, 215, 0.8);
--vp-c-brand-3: rgb(0, 120, 215);

--vp-home-hero-image-background-image: linear-gradient(-45deg, #0078D7 1%, #FFFFFF 50%);
--vp-home-hero-image-filter: blur(44px);
}

.dark {
/* --vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #bd34fe 30%, #41d1ff); */

--vp-home-hero-image-background-image: linear-gradient(-45deg, #18486e 55%, #000 50%);
--vp-home-hero-image-filter: blur(11px);
}

@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(56px);
}
}

@media (min-width: 960px) {
:root {
--vp-home-hero-image-filter: blur(68px);
}
}
</style>
Binary file added website/docs/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions website/docs/logo.svg
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 8827640

Please sign in to comment.