mirror of
https://github.com/pi-hole/docs.git
synced 2024-12-06 19:27:12 +01:00
Switch to GitHub Actions CI (#231)
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
name: Build and Deploy
|
||||
|
||||
env:
|
||||
CI: true
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.7'
|
||||
architecture: 'x64'
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: python3 -m pip install -r requirements.txt
|
||||
|
||||
- name: Build docs
|
||||
run: mkdocs build --clean --verbose
|
||||
|
||||
- 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@v2
|
||||
if: success()
|
||||
env:
|
||||
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
PUBLISH_DIR: ./site/
|
||||
with:
|
||||
emptyCommits: false
|
||||
@@ -0,0 +1,26 @@
|
||||
name: Test
|
||||
|
||||
env:
|
||||
CI: true
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
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'
|
||||
|
||||
- run: node --version
|
||||
- run: npm --version
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
language: python
|
||||
install:
|
||||
- pip install -r requirements.txt || travis_terminate 1
|
||||
- npm ci
|
||||
script:
|
||||
- npm test || travis_terminate 1
|
||||
- mkdocs build --verbose --clean
|
||||
cache: pip
|
||||
deploy:
|
||||
provider: pages
|
||||
keep-history: true
|
||||
skip_cleanup: true
|
||||
github_token: $GITHUB_TOKEN
|
||||
local_dir: site
|
||||
committer-from-gh: true
|
||||
verbose: true
|
||||
on:
|
||||
branch: master
|
||||
Reference in New Issue
Block a user