Allow writing contents when deploying #1369
Workflow file for this run
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
name: Build and deploy docs | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
jobs: | |
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 | |
with: | |
python-version: ${{ env.python-version }} | |
architecture: 'x64' | |
- name: Install Python dependencies | |
run: | | |
pip3 install -r build_requirements.txt | |
- name: Build documentation | |
working-directory: ${{ env.docs-directory }} | |
run: | | |
make html | |
# and there is no need to generate anything | |
- name: Generate nojekyll file | |
working-directory: ${{ env.docs-directory }}/generated_docs | |
run: touch .nojekyll | |
- 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 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: deploy-doc-site | |
folder: generated_docs | |
clean: true |