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

Allow writing contents when deploying #625

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
33 changes: 23 additions & 10 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

jobs:
build-and-deploy-docs:
build:
runs-on: ubuntu-latest
env:
docs-directory: /home/runner/work/kokkos-core-wiki/kokkos-core-wiki/docs
Expand All @@ -26,21 +26,34 @@ jobs:
working-directory: ${{ env.docs-directory }}
run: |
make html
- name: Archive documentation
uses: actions/upload-artifact@v4
with:
name: documentation.tar.gz
path: ${{ env.docs-directory }}/generated_docs
# .nojekyll file is needed for GitHub Pages to know it's getting a ready webpage
# and there is no need to generate anything
- name: Generate nojekyll file
working-directory: ${{ env.docs-directory }}/generated_docs
run: touch .nojekyll
# This action moves the content of `generated_docs` to the `deploy-doc-site` branch
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: site
path: ${{ env.docs-directory }}/generated_docs

deploy-docs:
if: ${{ github.ref == 'refs/heads/main' }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: site
path: generated_docs
- name: Deploy docs
if: ${{ github.ref == 'refs/heads/main' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: deploy-doc-site
folder: ${{ env.docs-directory }}/generated_docs
folder: generated_docs
clean: true