Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COH-31964 - Create a GitHub workflow action for updating Docs #222

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Changes from all commits
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
104 changes: 104 additions & 0 deletions .github/workflows/doc-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Copyright 2025, Oracle Corporation and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl.

# ---------------------------------------------------------------------------
# Coherence Python Client GitHub Documentation update Actions
# ---------------------------------------------------------------------------


name: Update Documentation for the project

on:
# Always triggered manually
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9.x"

- name: Install Poetry
shell: bash
run: |
pip install poetry=="1.8.4"

- name: Install Dependencies
run: python -m poetry install

- name: Generate docs
shell: bash
run: |
python -m poetry run make docs

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
name: "github-pages"
path: ./docs/_build

# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: github-pages
# path: .
#
# - name: Get latest release version
# id: get-version
# run: |
# version=$(git describe --tags $(git rev-list --tags --max-count=1))
# echo "get_released_ver=$version" >> "$GITHUB_ENV"
#
# - name: Print latest release version
# run: |
# echo "${{ env.get_released_ver }}"
#
# - name: Attach doc zip to release
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: ./artifact.tar
# asset_name: ${{ format('coherence_client-{0}-doc.tar', env.get_released_ver) }}
# asset_content_type: application/gzip

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or the latest "vX.X.X" version tag for this action
with:
artifact_name: github-pages