mirror of
https://github.com/pi-hole/docs.git
synced 2026-02-15 07:26:03 +00:00
Combine GitHub Actions
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
name: Build and Deploy
|
||||
name: CI
|
||||
|
||||
env:
|
||||
CI: true
|
||||
NODE: 12.x
|
||||
PYTHON_VERSION: '3.7'
|
||||
|
||||
on: [push, pull_request]
|
||||
@@ -35,14 +36,36 @@ jobs:
|
||||
|
||||
- name: Upload docs
|
||||
uses: actions/upload-artifact@v1
|
||||
if: success() && github.ref == 'refs/heads/master'
|
||||
with:
|
||||
name: docs
|
||||
path: ./site/
|
||||
|
||||
deploy:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Download docs
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: docs
|
||||
path: ./site/
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, test]
|
||||
if: github.ref == 'refs/heads/master'
|
||||
|
||||
steps:
|
||||
@@ -56,7 +79,6 @@ jobs:
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
if: success()
|
||||
with:
|
||||
emptyCommits: false
|
||||
personal_token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
23
.github/workflows/test.yml
vendored
23
.github/workflows/test.yml
vendored
@@ -1,23 +0,0 @@
|
||||
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'
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
Reference in New Issue
Block a user