Skip to content

Commit

Permalink
push to abe-101/dj-stripe.github.io
Browse files Browse the repository at this point in the history
  • Loading branch information
abe-101 committed May 8, 2024
1 parent 4986af9 commit c3b1a2a
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,62 @@ env:
POETRY_VERSION: "1.2.2"
POETRY_VIRTUALENVS_IN_PROJECT: "1"
LATEST_STABLE_BRANCH: "stable/2.7"
DOCS_REPO: "dj-stripe.github.io"
OWNER: "abe-101"
SOURCE_REPO: "dj-stripe"


jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout source repo
uses: actions/checkout@v4

- name: Checkout documentation repo
uses: actions/checkout@v4
with:
repository: "${{ env.OWNER }}/${{ env.DOCS_REPO }}"
path: ./${{ env.DOCS_REPO }}
# token: ${{ secrets.GH_PAT }} # Assuming it might be private


- uses: ./.github/install_poetry_action
with:
POETRY_VERSION: ${{ env.POETRY_VERSION }}
python_version: "3.12"

- name: Copy docs and configuration from source to documentation repo
run: |
ls -la
cp -r pyproject.toml mkdocs.yml docs ${{ env.DOCS_REPO }}/
sed -i 's|name = "dj-stripe"|name = "dj-stripe-docs"|' ${{ env.DOCS_REPO }}/pyproject.toml
sed -i 's|include = "djstripe"|include = "${{ env.SOURCE_REPO }}/djstripe"|' ${{ env.DOCS_REPO }}/pyproject.toml
cd ${{ env.DOCS_REPO }}
poetry add ../dj-stripe
- name: Install dependencies
run: poetry install --with docs
run:
cd ${{ env.DOCS_REPO }}
poetry install --with docs

- name: Configure git user to make commit
run: |
git config user.name "dj-stripe commit bot"
git config user.email "[email protected]"
- name: Fetch gh-pages remote changes (if any)
run: git fetch origin gh-pages --depth=1
run: |
cd ${{ env.DOCS_REPO }}
git fetch origin gh-pages --depth=1
- name: Deploy (and Update) docs for the branch, ${GITHUB_REF##*/}
run: poetry run mike deploy --push "${GITHUB_REF##*/}"
run: |
cd ${{ env.DOCS_REPO }}
poetry run mike deploy --push "${GITHUB_REF##*/}"
- name: Set default docs to ${LATEST_STABLE_BRANCH##*/}
run: poetry run mike set-default --push "${LATEST_STABLE_BRANCH##*/}"
run: |
cd ${{ env.DOCS_REPO }}
poetry run mike set-default --push "${LATEST_STABLE_BRANCH##*/}"

0 comments on commit c3b1a2a

Please sign in to comment.