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

creates build and pr to gh-page #1644

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
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
62 changes: 62 additions & 0 deletions .github/workflows/publish-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: ci

on:
push:
tags:
- v*

permissions:
contents: write
pull-requests: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: 3.x

- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache

- name: Install Python dependencies
run: pip install -r ./docs/pip-requirements.txt

- name: Configure git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

- name: Deploy docs to gh-pages
run: |
VERSION=${{ github.ref }}
VERSION=${VERSION#refs/tags/}
BASE_VERSION=${VERSION#v}

echo "Deploying documentation for version: $BASE_VERSION"

cd docs
mike deploy --update-aliases $BASE_VERSION latest

cd ..
git fetch origin gh-pages
git checkout gh-pages
git pull origin gh-pages

mkdir -p "./$BASE_VERSION" && cp -r docs/build/* "./$BASE_VERSION"

git add .
git commit -m "Update documentation for version $BASE_VERSION"
git push origin gh-pages

- name: Notify about PR
run: echo "Pull request created ${{ steps.create_pr.outputs.pr_url }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,43 @@
## Caliper benchmarks
1. Create a release in caliper-benchmarks corresponding to the new release, eg 0.7.0

## Documentation Deployment

This repository uses GitHub Actions to automate the deployment of documentation to GitHub Pages whenever a new version is tagged. Follow the steps below to change the version and deploy updated documentation.

### Steps to Change Version and Deploy Documentation

1. Create a Git Tag for the New Version

To deploy a new version of the documentation, start by creating a Git tag. For example:

```bash
git tag v1.2
```

2. Push the Tag to GitHub
Once the tag is created, push it to GitHub:

```bash
git push origin v1.2.3
```

Pushing the tag will automatically trigger the GitHub Actions CI pipeline defined in the .github/workflows/publish-doc.yml file.

3. CI Pipeline Actions
When the tag is pushed, the CI pipeline will execute the following steps:

Checkout Code: The latest version of the repository is pulled.
Setup Python: Python 3.x is set up and the required dependencies are installed from the docs/pip-requirements.txt.
Deploy Documentation: The mike deploy command is used to deploy the documentation to the gh-pages branch under the new version folder (/v1.2.3/).
Create Pull Request: A new branch is created to update the docs folder, and a pull request is opened to merge the changes into the main branch.

4. Merge the Pull Request
After the pull request is created, review the changes and merge it into the main branch. This ensures the documentation for the new version is available on the main repository.

5. Access the Documentation
Once the pull request is merged, the updated documentation can be accessed through GitHub Pages. The URL format will be:

```bash
https://hyperledger-caliper.github.io/caliper/
```
Loading