Merge pull request #216 from thegreenter/dependabot/pip/mkdocs-materi… #257
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: Greenter Docs | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -IU -r requirements.txt | |
pip install -U ghp-import | |
npm install | |
- name: Build | |
run: | | |
mkdocs build | |
npm run build-sw | |
- name: Deploy Mkdocs | |
run: | | |
git config user.name "Giancarlos Salas" | |
git config user.email "giansalex@gmail.com" | |
git remote add gh-token "https://${GH_TOKEN}@github.com/thegreenter/docs.git" | |
git fetch gh-token && git fetch gh-token gh-pages:gh-pages | |
ghp-import --remote=gh-token --message="Deployed MkDocs" --push site | |
env: | |
GH_TOKEN: ${{ secrets.ghToken }} | |