Skip to content

Commit

Permalink
Merge pull request #2 from hznuoj-dev/chore-upgrade-ci
Browse files Browse the repository at this point in the history
chore: upgrade ci
  • Loading branch information
Dup4 authored Jan 29, 2024
2 parents 74dc066 + 549c4d3 commit ac46589
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 67 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/deploy_doc.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,36 @@ on:
- main
workflow_dispatch:

env:
node_version: "18"
python_version: "3.10"
deploy_script_version: "v0.0.4"

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python runtime
uses: actions/setup-python@v3
with:
python-version: 3.9
python-version: "${{ env.python_version }}"

- name: Install Python dependencies
run: |
pip install -r requirements.txt
- uses: pnpm/action-setup@v2
with:
version: latest

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
node-version: "${{ env.node_version }}"
cache: pnpm

- name: Install Node dependencies
Expand Down Expand Up @@ -66,6 +69,8 @@ jobs:
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /var/docker-data/nginx/www
rm -rf wiki
git clone https://github.dup4.com/hznuoj-dev/wiki.git -b deploy-pages --depth=1
bash <(curl -s -L https://raw-github.dup4.com/Dup4/bash-script-snippet/${{ env.deploy_script_version }}/deploy_gh_pages.sh) \
-r hznuoj-dev/wiki \
-d /var/docker-data/nginx/www \
-b gh-pages \
-p github.dup4.com
36 changes: 0 additions & 36 deletions .github/workflows/lint.yml

This file was deleted.

33 changes: 14 additions & 19 deletions .github/workflows/build_doc.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# yaml-language-server: $schema=https://json-schema.org/draft-07/schema#
name: Build Doc
name: Test

on:
push:
Expand All @@ -10,53 +10,48 @@ on:
- main
workflow_dispatch:

env:
node_version: "18"
python_version: "3.10"

jobs:
build-doc:
test:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python runtime
uses: actions/setup-python@v3
with:
python-version: 3.9
python-version: "${{ env.python_version }}"

- name: Install Python dependencies
run: |
pip install -r requirements.txt
- uses: pnpm/action-setup@v2
with:
version: latest

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
node-version: "${{ env.node_version }}"
cache: pnpm

- name: Install Node dependencies
run: |
pnpm i
- name: Lint
run: |
pnpm lint
- name: Build
env:
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
ENABLE_MATHJAX: false
run: |
pnpm build
- name: Deploy to gh-pages
if: ${{ github.event_name != 'pull_request' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site
force_orphan: true
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
commit_message: 🚀 Deploying to gh-pages @ ${{ env.GITHUB_SHA }}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"escapeall",
"fontawesome",
"hardbreak",
"HZNUOJ",
"inlinehilite",
"linenums",
"magiclink",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HZNUOJ Develop Team Wiki
# HZNUOJ Development Team Wiki

[![Lint](https://github.com/hznuoj-dev/wiki/actions/workflows/lint.yml/badge.svg)](https://github.com/hznuoj-dev/wiki/actions/workflows/lint.yml)
[![Build Doc](https://github.com/hznuoj-dev/wiki/actions/workflows/build_doc.yml/badge.svg)](https://github.com/hznuoj-dev/wiki/actions/workflows/build_doc.yml)
[![Test](https://github.com/hznuoj-dev/wiki/actions/workflows/test.yml/badge.svg)](https://github.com/hznuoj-dev/wiki/actions/workflows/test.yml)
[![Deploy](https://github.com/hznuoj-dev/wiki/actions/workflows/deploy.yml/badge.svg)](https://github.com/hznuoj-dev/wiki/actions/workflows/deploy.yml)
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "hznuoj-wiki",
"private": true,
"packageManager": "pnpm@8.15.0",
"scripts": {
"build": "bash build.sh",
"dev": "mkdocs serve",
Expand All @@ -8,6 +10,7 @@
},
"devDependencies": {
"mkdocs-render-math-ssr": "^1.0.5",
"pnpm": "^8.15.0",
"remark-cli": "^10.0.1",
"remark-preset-lint-mkdocs-material": "^0.6.0"
}
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ac46589

Please sign in to comment.