-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs.yaml, update test.yaml, vuepress
- Loading branch information
1 parent
474c322
commit 765f398
Showing
4 changed files
with
107 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Deploy Documentation | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Test"] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
build-deploy: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
working-directory: './docs' | ||
|
||
- name: Download coverage artifacts | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: ${{github.event.workflow_run.id }}, | ||
}); | ||
var matchArtifacts = artifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name.startsWith("Coverage results for") | ||
}); | ||
for (const artifact of matchArtifacts) { | ||
var download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: artifact.id, | ||
archive_format: 'zip', | ||
}); | ||
var fs = require('fs'); | ||
fs.writeFileSync(`${{github.workspace}}/${artifact.name}.zip`, Buffer.from(download.data)); | ||
} | ||
- name: Extract coverage reports | ||
run: | | ||
mkdir -p ./docs/.vuepress/public/coverage | ||
for file in Coverage*.zip; do | ||
mode=$(echo $file | sed 's/Coverage results for \(.*\)\.zip/\1/') | ||
unzip -o "$file" -d "./docs/.vuepress/public/coverage/$mode" | ||
done | ||
- name: Build documentation | ||
run: npm run docs:build | ||
working-directory: './docs' | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: 'docs/.vuepress/dist' | ||
|
||
deploy: | ||
needs: build-deploy | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
title: 'Micromissiles Unity Project', | ||
description: 'Documentation for the Micromissiles Unity project', | ||
themeConfig: { | ||
navbar: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: 'Keybinds and Controls', link: '/Keybinds_and_Controls.html' }, | ||
{ text: 'Simulation Configuration Guide', link: '/Simulation_Config_Guide.html' }, | ||
{ text: 'Simulation Logging', link: '/Simulation_Logging.html' }, | ||
], | ||
sidebar: 'auto', | ||
}, | ||
extendsPageData: (pageData) => { | ||
if (pageData.relativePath === 'README.md') { | ||
pageData.frontmatter.home = true; | ||
} | ||
}, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"scripts": { | ||
"docs:dev": "vuepress dev .", | ||
"docs:build": "vuepress build ." | ||
}, | ||
"devDependencies": { | ||
"vuepress": "^2.0.0-beta.51" | ||
} | ||
} |