mirror of
https://github.com/pi-hole/docs.git
synced 2024-12-06 19:27:12 +01:00
Merge pull request #286 from pi-hole/linkinator
Add linkinator and improve CI scripts
This commit is contained in:
@@ -1,70 +0,0 @@
|
||||
name: Build and Deploy
|
||||
|
||||
env:
|
||||
CI: true
|
||||
PYTHON_VERSION: '3.7'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- "**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '${{ env.PYTHON_VERSION }}'
|
||||
architecture: 'x64'
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: python3 -m pip install -r requirements.txt
|
||||
|
||||
- name: Build docs
|
||||
run: mkdocs build --clean
|
||||
|
||||
- name: Upload docs
|
||||
uses: actions/upload-artifact@v1
|
||||
if: success() && github.ref == 'refs/heads/master'
|
||||
with:
|
||||
name: docs
|
||||
path: ./site/
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/master'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Download docs
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: docs
|
||||
path: ./site/
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
if: success()
|
||||
with:
|
||||
emptyCommits: false
|
||||
personal_token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
publish_branch: gh-pages
|
||||
publish_dir: ./site/
|
||||
@@ -0,0 +1,48 @@
|
||||
name: CI
|
||||
|
||||
env:
|
||||
CI: true
|
||||
NODE: 12.x
|
||||
PYTHON_VERSION: '3.7'
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '${{ env.PYTHON_VERSION }}'
|
||||
architecture: 'x64'
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
|
||||
|
||||
- run: pip install --upgrade wheel
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: python3 -m pip install -r requirements.txt
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build docs
|
||||
run: mkdocs build
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
@@ -1,29 +0,0 @@
|
||||
name: Test
|
||||
|
||||
env:
|
||||
CI: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- "**"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12'
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
Generated
+1692
File diff suppressed because it is too large
Load Diff
+4
-1
@@ -16,10 +16,13 @@
|
||||
},
|
||||
"homepage": "https://docs.pi-hole.net/",
|
||||
"scripts": {
|
||||
"build": "mkdocs build --clean",
|
||||
"markdownlint": "markdownlint \"**/*.md\" -i \"**/node_modules/**\"",
|
||||
"test": "npm run markdownlint"
|
||||
"linkinator": "linkinator site --recurse --silent --skip \"^(?!http://localhost)\"",
|
||||
"test": "npm run markdownlint && npm run linkinator"
|
||||
},
|
||||
"devDependencies": {
|
||||
"linkinator": "^2.1.1",
|
||||
"markdownlint-cli": "^0.23.1"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user