Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add GH actions deploy script
  • Loading branch information
AA-Turner committed Jun 8, 2021
commit 0f2033e932dadcf8ac0f589dc0e42d3b1e7a9dcd
44 changes: 44 additions & 0 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy to GitHub Pages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AA-Turner I think we don't deploy on the GitHub pages... What's the reason for this workflow?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't currently. #1385 has extensive discussion on this (#1385 (comment) etc) - the main drive is that deploying to GH pages is easy and free, and enables previewing the changes before any switchovers etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also discussion in various other issues (#2, #3, #25) and others I've likely forgoton (may be some on the pythondotorg repo)


on: [push]

jobs:
deploy-to-pages:
runs-on: ubuntu-latest

steps:
- name: πŸ›ŽοΈ Checkout
uses: actions/checkout@v2

- name: 🐍 Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: 🧳 Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-

# Install dependencies and build PEPs using sphinx
- name: πŸ‘·β€ Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
make pages

# Install dependencies and build PEPs using sphinx
- name: πŸ”§ Build PEPs
run: make pages

- name: πŸš€ Deploy to GitHub pages
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: build # The folder the action should deploy.