Skip to content

Commit 40f7b10

Browse files
committed
setup deployment pipeline
Signed-off-by: seven <zilisheng1996@gmail.com>
1 parent 6c2e809 commit 40f7b10

File tree

9 files changed

+78
-50
lines changed

9 files changed

+78
-50
lines changed

.github/dependabot.yml

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

.github/workflows/page-site.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: generate page site
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
checks: write
13+
contents: write
14+
deployments: write
15+
name: Publish to Cloudflare Pages
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Use Node.js 20.x
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20.x
23+
cache: 'npm'
24+
- run: npm ci
25+
- run: npm run docs:build
26+
- name: Generate changelog
27+
uses: jaywcjlove/changelog-generator@main
28+
if: ${{ github.ref == 'refs/heads/master' }}
29+
id: changelog
30+
with:
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Build Release
33+
uses: jaywcjlove/create-tag-action@main
34+
if: ${{ github.ref == 'refs/heads/master' }}
35+
id: tag_release
36+
with:
37+
release: true
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
body: |
40+
${{ steps.changelog.outputs.compareurl }}
41+
42+
${{ steps.changelog.outputs.changelog }}
43+
- name: Publish to Cloudflare Pages
44+
uses: cloudflare/pages-action@v1
45+
if: steps.tag_release.outputs.successful
46+
with:
47+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
48+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
49+
projectName: geekfun-site
50+
directory: dist
51+
# Optional: Enable this if you want to have GitHub Deployments triggered
52+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
53+
branch: main
54+
environment: production

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ docs/.vitepress/cache
44
/dist/
55
/.idea/
66
.DS_Store
7+
/cache/

README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,2 @@
1-
# geekfunfront
1+
# GEEKFUN Official Website
22

3-
> A Vue.js project
4-
5-
## Build Setup
6-
7-
``` bash
8-
# install dependencies
9-
npm install
10-
11-
# serve with hot reload at localhost:8080
12-
npm run dev
13-
14-
# build for production with minification
15-
npm run build
16-
17-
# build for production and view the bundle analyzer report
18-
npm run build --report
19-
```
20-
21-
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

docs/.vitepress/config.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {defineConfig} from "vitepress";
1+
import {defineConfig} from 'vitepress'
22

33
const icon = '/favicon.ico';
44
const sharedThemeConfig = {
@@ -20,6 +20,8 @@ const descZh = '极客范是一个软件社区,致力于构建可持续的开
2020

2121
export default defineConfig({
2222
lastUpdated: true,
23+
outDir: '../dist',
24+
cacheDir: '../cache',
2325
locales: {
2426
root: {
2527
label: 'English',
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
<template>
2-
<VPTeamMembers size="small" :members="members" />
3-
</template>
41
<script setup>
5-
import { VPTeamMembers } from 'vitepress/theme'
2+
import {VPTeamMembers} from 'vitepress/theme'
63
74
const members = [
85
{
@@ -11,9 +8,9 @@ const members = [
118
title: 'Creator',
129
desc: '好好学习,天天向上',
1310
links: [
14-
{ icon: 'github', link: 'https://github.com/Blankll' },
15-
{ icon: 'twitter', link: 'https://x.com/Blankll31075' },
16-
{ icon: 'youtube', link: 'https://www.youtube.com/@geekfun-club' }
11+
{icon: 'github', link: 'https://github.com/Blankll'},
12+
{icon: 'twitter', link: 'https://x.com/Blankll31075'},
13+
{icon: 'youtube', link: 'https://www.youtube.com/@geekfun-club'}
1714
]
1815
},
1916
{
@@ -22,9 +19,12 @@ const members = [
2219
title: 'Contributor',
2320
desc: '生活如此美好,而我且如此暴躁。',
2421
links: [
25-
{ icon: 'github', link: 'https://github.com/VisionView' },
26-
{ icon: 'blog', link: 'https://blog.csdn.net/Vision_Pinna/' }
22+
{icon: 'github', link: 'https://github.com/VisionView'},
23+
{icon: 'blog', link: 'https://blog.csdn.net/Vision_Pinna/'}
2724
]
2825
},
2926
]
3027
</script>
28+
<template>
29+
<VPTeamMembers size="small" :members="members"/>
30+
</template>

docs/.vitepress/theme/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import DefaultTheme from 'vitepress/theme'
1+
import DefaultTheme from 'vitepress/theme';
22
import {inBrowser, useData} from "vitepress";
33
import {watchEffect} from "vue";
4-
import teamMembers from './components/team-members.vue';
4+
import TeamMembers from './components/team-members.vue';
55

66
export default {
77
...DefaultTheme,
@@ -15,7 +15,7 @@ export default {
1515
},
1616
enhanceApp({app}) {
1717
// register your custom global components
18-
app.component('TeamMembers', teamMembers);
18+
app.component('TeamMembers', TeamMembers);
1919
}
2020
}
2121

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"name": "website",
2+
"name": "geekfun-site",
33
"version": "1.0.0",
44
"description": "",
5-
"type": "module",
5+
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
88
"docs:dev": "vitepress dev docs",
99
"docs:build": "vitepress build docs",
1010
"docs:preview": "vitepress preview docs"
1111
},
1212
"keywords": [],
13-
"author": "",
14-
"license": "ISC",
13+
"author": "geekfun <support@geekfun.club>",
14+
"license": "Apache-2.0",
1515
"devDependencies": {
1616
"vitepress": "^1.3.4"
1717
}

0 commit comments

Comments
 (0)