a11y: use more semantic html elements #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
# 构建工作 | |
build_demo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要 | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Configure Hexo Unit Test # 配置 Hexo 单元测试 | |
run: | | |
git clone https://github.com/hexojs/hexo-theme-unit-test.git ~/unit_test | |
mkdir -p ~/unit_test/themes/SoSimple | |
cp -r ./* ~/unit_test/themes/SoSimple/ | |
cd ~/unit_test/themes/SoSimple | |
pnpm i | |
cd /home/runner/work/hexo-theme-sosimple/hexo-theme-sosimple | |
cp ./_config.example.yml ~/unit_test/themes/SoSimple/_config.yml | |
cp ./.github/assets/hexo_config.yml ~/unit_test/_config.yml | |
cp ./.github/assets/_posts/* ~/unit_test/source/_posts/ | |
cd ~/unit_test | |
npm install | |
npm install hexo-renderer-pug --save | |
npx hexo new "SoSimple简介" | |
cat /home/runner/work/hexo-theme-sosimple/hexo-theme-sosimple/README.md >> ./source/_posts/SoSimple简介.md | |
- name: Generate Test # 生成 Hexo 单元测试 | |
run: | | |
cd ~/unit_test | |
npx hexo g -b | |
- name: Echo Home | |
run: echo $HOME | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: /home/runner/unit_test/public | |
# 部署工作 | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build_demo | |
runs-on: ubuntu-latest | |
name: Deploy | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |