Merge pull request #463 from readthedocs/davidfischer/q12025-prospect… #436
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: Build and Deploy Site to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Install Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- name: Build static assets | |
run: | | |
npm clean-install | |
npm run dist | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: pelican-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
pelican- | |
- name: Install Pelican | |
run: | | |
pip install -r requirements.txt | |
- name: Run Pelican | |
id: run-pelican | |
run: | | |
inv preview | |
# This step installs the ssh client into the workflow run. | |
# There's many options available for this on the action marketplace. | |
- name: Install SSH Client | |
uses: webfactory/ssh-agent@v0.4.1 | |
with: | |
ssh-private-key: ${{ secrets.DEPLOY_KEY }} | |
- name: Build and Deploy Repo | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
BASE_BRANCH: main | |
BRANCH: gh-pages | |
FOLDER: output | |
CLEAN: true | |
SSH: true # SSH must be set to true so the deploy action knows which protocol to deploy with. |