Skip to content

Commit

Permalink
try github-pages-deploy-action
Browse files Browse the repository at this point in the history
  • Loading branch information
leofang committed Dec 28, 2024
1 parent c8424da commit 45218b8
Showing 1 changed file with 11 additions and 45 deletions.
56 changes: 11 additions & 45 deletions .github/workflows/gh-build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,48 +115,14 @@ jobs:
path: artifacts/
retention-days: 3

# The steps below are not executed unless when building on main.
- name: Configure git
if: ${{ github.ref_name == 'main' }}
run: |
git config --local user.email "noreply@nvidia.com"
git config --local user.name "cuda-python-bot"
- name: Checkout the gh-pages branch
if: ${{ github.ref_name == 'main' }}
run: |
git fetch origin gh-pages
git checkout gh-pages
- name: Move artifacts to doc root
if: ${{ github.ref_name == 'main' }}
run: |
mv artifacts/docs/* docs/
git status
- name: Commit changes
if: ${{ github.ref_name == 'main' }}
run: |
git add docs/
git status
git commit -m "Deploy: ${{ github.sha }}"
continue-on-error: true

- name: Push changes
if: ${{ github.ref_name == 'main' && success() }}
run: |
git push origin gh-pages
# TODO: discuss if we want to abandon branch-based doc deployment
# deploy:
# # Only deploy the latest docs when building on main
# if: ${{ github.ref_name == 'main' }}
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v4
# The step below is not executed unless when building on main.
- name: Deploy doc update
#if: ${{ github.ref_name == 'main' && success() }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: artifacts/docs/
git-config-name: cuda-python-bot
target-folder: docs/
commit-message: "Deploy latest docs: ${{ github.sha }}"
clean: false
dry-run: true

0 comments on commit 45218b8

Please sign in to comment.