Skip to content

Commit dcd69b1

Browse files
authored
Update docs deploy scripts
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).
1 parent a63e6f3 commit dcd69b1

File tree

2 files changed

+38
-21
lines changed

2 files changed

+38
-21
lines changed

.github/workflows/deploy.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,16 @@ jobs:
4949
ghpages:
5050
runs-on: ubuntu-latest
5151
steps:
52-
- uses: actions/checkout@v4
52+
- name: Checkout Source Repo
53+
uses: actions/checkout@v4
54+
with:
55+
path: md
56+
- name: Checkout Target Repo
57+
uses: actions/checkout@v4
58+
with:
59+
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
60+
repository: Python-Markdown/Python-Markdown.github.io
61+
path: target
5362
- name: Setup Python
5463
uses: actions/setup-python@v4
5564
with:
@@ -60,15 +69,11 @@ jobs:
6069
python -m pip install .[docs]
6170
- name: Build
6271
run: |
72+
cd md
6373
python -m mkdocs build --clean --verbose
6474
- name: Publish
6575
if: success()
66-
uses: cpina/github-action-push-to-another-repository@main
67-
env:
68-
SSH_DEPLOY_KEY: ${{ secrets.PAGES_DEPLOY_KEY }}
69-
with:
70-
source-directory: 'site'
71-
destination-github-username: 'Python-Markdown'
72-
destination-repository-name: 'Python-Markdown.github.io'
73-
user-name: ${{ github.actor }}
74-
target-branch: master
76+
run: |
77+
cd target
78+
git config user.email [email protected]
79+
python -m ghp-import --push --no-jekyll --branch=master ../md/site

.github/workflows/manual_deploy.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
name: manual deploy
22

33
on:
4-
workflow_dispatch
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: 'The branch, tag or SHA to checkout and build.'
8+
type: string
9+
required: true
10+
default: master
511

612
jobs:
713

814
ghpages:
915
runs-on: ubuntu-latest
1016
steps:
11-
- uses: actions/checkout@v4
17+
- name: Checkout Source Repo
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ inputs.ref }}
21+
path: md
22+
- name: Checkout Target Repo
23+
uses: actions/checkout@v4
24+
with:
25+
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
26+
repository: Python-Markdown/Python-Markdown.github.io
27+
path: target
1228
- name: Setup Python
1329
uses: actions/setup-python@v4
1430
with:
@@ -19,15 +35,11 @@ jobs:
1935
python -m pip install .[docs]
2036
- name: Build
2137
run: |
38+
cd md
2239
python -m mkdocs build --clean --verbose
2340
- name: Publish
2441
if: success()
25-
uses: cpina/github-action-push-to-another-repository@main
26-
env:
27-
SSH_DEPLOY_KEY: ${{ secrets.PAGES_DEPLOY_KEY }}
28-
with:
29-
source-directory: 'site'
30-
destination-github-username: 'Python-Markdown'
31-
destination-repository-name: 'Python-Markdown.github.io'
32-
user-name: ${{ github.actor }}
33-
target-branch: master
42+
run: |
43+
cd target
44+
git config user.email [email protected]
45+
python -m ghp-import --push --no-jekyll --branch=master ../md/site

0 commit comments

Comments
 (0)