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

Update action to deploy to GitHub pages #623

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
51 changes: 24 additions & 27 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,38 @@ 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
python-version: '3.10'

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v4
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: ${{ env.python-version }}
architecture: 'x64'
- name: Install Python dependencies
run: |
pip3 install -r build_requirements.txt
python-version: '3.10'
- run: pip install -r build_requirements.txt
- name: Build documentation
working-directory: ${{ env.docs-directory }}
run: |
make html
- name: Archive documentation
uses: actions/upload-artifact@v4
- name: Updload documentation as artifact
id: deployment
uses: actions/[email protected]
with:
name: documentation.tar.gz
name: github-pages
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: 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
clean: true

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]
Loading