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

Add website CI build with artifacts for pull requests #36

Merged
merged 5 commits into from
Feb 27, 2024
Merged
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
27 changes: 23 additions & 4 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
name: Build and deploy OFT website using GitHub Pages

on:
# Runs on pushes targeting the default branch
# Runs on pushes targeting main or gh-pages branch (deploy on gh-pages only)
push:
branches: ["gh-pages"]
branches: ["gh-pages", "main"]
pull_request:
types: [opened, reopened, synchronize]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -41,7 +43,14 @@ jobs:
- name: Create build dir
run: mkdir build_docs

- name: Configure OFT documentation
- name: Configure OFT documentation (nightly)
if: github.ref != 'ref/head/gh-pages'
shell: bash
working-directory: build_docs
run: cmake -DOFT_BUILD_DOCS:BOOL=ON -DOFT_DOCS_ONLY:BOOL=ON -DOFT_PACKAGE_NIGHTLY:BOOL=ON ../src

- name: Configure OFT documentation (deploy)
if: github.ref == 'ref/head/gh-pages'
shell: bash
working-directory: build_docs
run: cmake -DOFT_BUILD_DOCS:BOOL=ON -DOFT_DOCS_ONLY:BOOL=ON -DOFT_PACKAGE_NIGHTLY:BOOL=OFF ../src
Expand All @@ -61,12 +70,22 @@ jobs:
chmod -c -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done

- name: Upload actions artifact
if: github.ref != 'ref/head/gh-pages'
uses: actions/upload-artifact@v4
with:
name: pull_${{ github.event.pull_request.number }}-website
path: _site/
overwrite: true

- name: Upload artifact
- name: Upload pages artifact
if: github.ref == 'ref/head/gh-pages'
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
if: github.ref == 'ref/head/gh-pages'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down