Skip to content

Commit

Permalink
Update docs deploy scripts
Browse files Browse the repository at this point in the history
The update in 5cbabe1 didn't provide for a .nojekyll file, which is necessary when publishing to GitHub Pages to avoid Jekyll messing with our statically generated documentation.

Also added a user input to the manual deploy script which allows deploying from any past reference (tag or commit).
  • Loading branch information
waylan committed Nov 6, 2023
1 parent a63e6f3 commit dcd69b1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 21 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,16 @@ jobs:
ghpages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Source Repo
uses: actions/checkout@v4
with:
path: md
- name: Checkout Target Repo
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
repository: Python-Markdown/Python-Markdown.github.io
path: target
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand All @@ -60,15 +69,11 @@ jobs:
python -m pip install .[docs]
- name: Build
run: |
cd md
python -m mkdocs build --clean --verbose
- name: Publish
if: success()
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.PAGES_DEPLOY_KEY }}
with:
source-directory: 'site'
destination-github-username: 'Python-Markdown'
destination-repository-name: 'Python-Markdown.github.io'
user-name: ${{ github.actor }}
target-branch: master
run: |
cd target
git config user.email waylan.limberg@icloud.com
python -m ghp-import --push --no-jekyll --branch=master ../md/site
34 changes: 23 additions & 11 deletions .github/workflows/manual_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
name: manual deploy

on:
workflow_dispatch
workflow_dispatch:
inputs:
ref:
description: 'The branch, tag or SHA to checkout and build.'
type: string
required: true
default: master

jobs:

ghpages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Source Repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
path: md
- name: Checkout Target Repo
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
repository: Python-Markdown/Python-Markdown.github.io
path: target
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand All @@ -19,15 +35,11 @@ jobs:
python -m pip install .[docs]
- name: Build
run: |
cd md
python -m mkdocs build --clean --verbose
- name: Publish
if: success()
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.PAGES_DEPLOY_KEY }}
with:
source-directory: 'site'
destination-github-username: 'Python-Markdown'
destination-repository-name: 'Python-Markdown.github.io'
user-name: ${{ github.actor }}
target-branch: master
run: |
cd target
git config user.email waylan.limberg@icloud.com
python -m ghp-import --push --no-jekyll --branch=master ../md/site

0 comments on commit dcd69b1

Please sign in to comment.