Skip to content

Commit 808672b

Browse files
authored
COH-31964 - Create a GitHub workflow action for updating Docs (#222)
1 parent b0ad427 commit 808672b

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed

.github/workflows/doc-update.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Copyright 2025, Oracle Corporation and/or its affiliates. All rights reserved.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at
3+
# https://oss.oracle.com/licenses/upl.
4+
5+
# ---------------------------------------------------------------------------
6+
# Coherence Python Client GitHub Documentation update Actions
7+
# ---------------------------------------------------------------------------
8+
9+
10+
name: Update Documentation for the project
11+
12+
on:
13+
# Always triggered manually
14+
workflow_dispatch:
15+
16+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
17+
permissions:
18+
contents: write
19+
pages: write
20+
id-token: write
21+
22+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
23+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
24+
concurrency:
25+
group: "pages"
26+
cancel-in-progress: false
27+
28+
jobs:
29+
build:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.9.x"
37+
38+
- name: Install Poetry
39+
shell: bash
40+
run: |
41+
pip install poetry=="1.8.4"
42+
43+
- name: Install Dependencies
44+
run: python -m poetry install
45+
46+
- name: Generate docs
47+
shell: bash
48+
run: |
49+
python -m poetry run make docs
50+
51+
- name: Setup Pages
52+
id: pages
53+
uses: actions/configure-pages@v5
54+
55+
- name: Upload artifact
56+
uses: actions/upload-pages-artifact@v3
57+
with:
58+
name: "github-pages"
59+
path: ./docs/_build
60+
61+
# - name: Download artifact
62+
# uses: actions/download-artifact@v4
63+
# with:
64+
# name: github-pages
65+
# path: .
66+
#
67+
# - name: Get latest release version
68+
# id: get-version
69+
# run: |
70+
# version=$(git describe --tags $(git rev-list --tags --max-count=1))
71+
# echo "get_released_ver=$version" >> "$GITHUB_ENV"
72+
#
73+
# - name: Print latest release version
74+
# run: |
75+
# echo "${{ env.get_released_ver }}"
76+
#
77+
# - name: Attach doc zip to release
78+
# uses: actions/upload-release-asset@v1
79+
# env:
80+
# GITHUB_TOKEN: ${{ github.token }}
81+
# with:
82+
# upload_url: ${{ github.event.release.upload_url }}
83+
# asset_path: ./artifact.tar
84+
# asset_name: ${{ format('coherence_client-{0}-doc.tar', env.get_released_ver) }}
85+
# asset_content_type: application/gzip
86+
87+
# Deploy job
88+
deploy:
89+
# Add a dependency to the build job
90+
needs: build
91+
92+
# Deploy to the github-pages environment
93+
environment:
94+
name: github-pages
95+
url: ${{ steps.deployment.outputs.page_url }}
96+
97+
# Specify runner + deployment step
98+
runs-on: ubuntu-latest
99+
steps:
100+
- name: Deploy to GitHub Pages
101+
id: deployment
102+
uses: actions/deploy-pages@v4 # or the latest "vX.X.X" version tag for this action
103+
with:
104+
artifact_name: github-pages

0 commit comments

Comments
 (0)