Skip to content

Commit cf9481e

Browse files
authored
Github pages website (#712)
* Update config.js * Create docs.yml * Update docs.yml * Update docs.yml * Update docs.yml * Update docs.yml * Update docs.yml * Update docs.yml * Update config.js * Update docs.yml * Update docs.yml
1 parent 2e32a3f commit cf9481e

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/docs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: docs
2+
3+
on:
4+
# trigger deployment on every push to main branch
5+
push:
6+
branches: [main]
7+
# trigger deployment manually
8+
workflow_dispatch:
9+
10+
jobs:
11+
docs:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
# fetch all commits to get last updated time or other git log info
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
# choose node.js version to use
24+
node-version: 16
25+
26+
- name: Install deps
27+
working-directory: ./docs
28+
run: npm install
29+
30+
- name: Copy changelog
31+
run: cp CHANGELOG.md docs/changelog.md
32+
33+
- name: Copy assets
34+
run: |
35+
mkdir -p docs/.vuepress/public
36+
cp art/logo_mixed.gif docs/.vuepress/public/logo.gif
37+
cp art/heart.svg docs/.vuepress/public/heart.svg
38+
cp art/heart.png docs/.vuepress/public/heart.png
39+
40+
# run build script
41+
- name: Build VuePress site
42+
working-directory: ./docs
43+
run: npx vuepress build
44+
45+
# please check out the docs of the workflow for more details
46+
# @see https://github.com/crazy-max/ghaction-github-pages
47+
- name: Deploy to GitHub Pages
48+
uses: crazy-max/ghaction-github-pages@v4
49+
with:
50+
# deploy to gh-pages branch
51+
target_branch: gh-pages
52+
# deploy the default output dir of VuePress
53+
build_dir: docs/.vuepress/dist
54+
env:
55+
# @see https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/.vuepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
base: '/phpinsights/',
23
title: 'PHP Insights',
34
description: 'The perfect starting point to analyze the code quality of your PHP projects',
45
sidebar: true,

0 commit comments

Comments
 (0)