-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from scylladb/revert-37-revert-34-publish-manu…
…al-scripts docs: add scripts publish docs.scylladb.com/manual
- Loading branch information
Showing
7 changed files
with
122 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Docs / Publish docs.scylladb.com/manual" | ||
|
||
env: | ||
FLAG: 'manual' | ||
|
||
on: | ||
schedule: | ||
# Run daily at 00:00 UTC | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.repository.default_branch }} | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Fetch submodules latest version | ||
run: | | ||
git submodule sync | ||
git submodule update --init --remote | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Set up env | ||
run: make -C submodules/scylladb/docs FLAG="${{ env.FLAG }}" setupenv | ||
|
||
- name: Build docs | ||
run: make -C submodules/scylladb/docs FLAG="${{ env.FLAG }}" multiversion | ||
|
||
- name: Build redirects | ||
run: make -C submodules/scylladb/docs FLAG="${{ env.FLAG }}" redirects | ||
|
||
- name: Deploy docs to GitHub Pages | ||
run: ./scripts/deploy_manual.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "submodules/scylladb"] | ||
path = submodules/scylladb | ||
url = https://github.com/scylladb/scylladb.git |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Variables | ||
REPO_URL="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | ||
GH_PAGES_DIR="gh-pages" | ||
|
||
echo "Preparing docs dir..." | ||
mkdir -p $GH_PAGES_DIR | ||
cp -r ./submodules/scylladb/docs/_build/dirhtml/. $GH_PAGES_DIR | ||
|
||
if git ls-remote --heads "$REPO_URL" gh-pages; then | ||
echo "Cloning existing gh-pages branch..." | ||
git clone --branch gh-pages --single-branch "$REPO_URL" "${GH_PAGES_DIR}-existing" | ||
cd "${GH_PAGES_DIR}-existing" | ||
|
||
echo "Cleaning up existing content..." | ||
rm -rf manual | ||
|
||
echo "Copying new documentation..." | ||
mkdir -p manual | ||
cp -a ../$GH_PAGES_DIR/. manual/ | ||
|
||
echo "Configuring Git..." | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
|
||
echo "Committing and pushing changes..." | ||
git add . | ||
git commit -m "Update docs" || true | ||
git push origin gh-pages --force | ||
|
||
else | ||
echo "Error: The gh-pages branch does not exist in the repository." | ||
echo "Please create a gh-pages branch in your repository and re-run the script." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Variables | ||
REPO_URL="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | ||
GH_PAGES_DIR="gh-pages" | ||
|
||
echo "Preparing docs dir..." | ||
mkdir -p $GH_PAGES_DIR | ||
cp -r ./docs/_build/dirhtml/. $GH_PAGES_DIR | ||
|
||
if git ls-remote --heads "$REPO_URL" gh-pages; then | ||
echo "Cloning existing gh-pages branch..." | ||
git clone --branch gh-pages --single-branch "$REPO_URL" "${GH_PAGES_DIR}-existing" | ||
cd "${GH_PAGES_DIR}-existing" | ||
|
||
echo "Cleaning up existing content..." | ||
find . -mindepth 1 -not -path './.git*' -not -path './manual*' -exec rm -rf {} + | ||
|
||
echo "Copying new documentation..." | ||
cp -a ../$GH_PAGES_DIR/. . | ||
|
||
echo "Configuring Git..." | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
|
||
echo "Committing and pushing changes..." | ||
git add . | ||
git commit -m "Update docs" || true | ||
git push origin gh-pages --force | ||
else | ||
echo "Error: The gh-pages branch does not exist in the repository." | ||
echo "Please create a gh-pages branch in your repository and re-run the script." | ||
exit 1 | ||
fi |