Skip to content

Commit

Permalink
Build: create a separate workflow for releasing docs (alexklibisz#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexklibisz authored Mar 28, 2024
1 parent 1737f00 commit 4893afe
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 38 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release
on:
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

jobs:
release-docs:
needs: release-python-client
if: ${{ github.ref == 'refs/heads/main' }}
runs-on:
- ubuntu-22.04
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10.8'
cache: 'pip'
- uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Jekyll Site
run: |
sudo chown -R runneradmin:runneradmin docs
task docsCompile
sudo chown -R runner:docker docs
- name: Generate Python Docs
run: |
task pyDocs
mkdir -p docs/_site/docs
mv client-python/pdoc/elastiknn docs/_site/docs/pdoc
- name: Configure Pages
uses: actions/configure-pages@v2
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'docs/_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
39 changes: 1 addition & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,41 +66,4 @@ jobs:
run: task pyPublishRelease
- name: Publish Snapshot
if: ${{ github.event.inputs.full-release != 'true' }}
run: task pyPublishSnapshot VERSION=$(cat version)-dev${{ github.run_number }}${{ github.run_attempt }}
release-docs:
needs: release-python-client
if: ${{ github.ref == 'refs/heads/main' && github.event.inputs.full-release == 'true' }}
runs-on:
- ubuntu-22.04
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10.8'
cache: 'pip'
- uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Jekyll Site
run: |
sudo chown -R runneradmin:runneradmin docs
task docsCompile
sudo chown -R runner:docker docs
- name: Generate Python Docs
run: |
task pyDocs
mkdir -p docs/_site/docs
mv client-python/pdoc/elastiknn docs/_site/docs/pdoc
- name: Configure Pages
uses: actions/configure-pages@v2
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'docs/_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
run: task pyPublishSnapshot VERSION=$(cat version)-dev${{ github.run_number }}${{ github.run_attempt }}

0 comments on commit 4893afe

Please sign in to comment.