diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 993f85f6f2e..02f927059d9 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -2,28 +2,35 @@ name: Publish documentation to gh-pages -on: - push: - branches: - - develop -env: - ALPAKA_CI_OS_NAME: "Linux" +on: [push, pull_request] jobs: - gh-pages: + build: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install doxygen - run: | - cd ${GITHUB_WORKSPACE} - ./script/install_doxygen.sh - - name: Run doxygen - run: | - cd ${GITHUB_WORKSPACE} - ./script/run_doxygen.sh ${{ github.repository }} ${{ secrets.github_token }} - - name: Publish documentation - run: | - cd ${GITHUB_WORKSPACE} - ./script/push_doc.sh + - uses: actions/checkout@v4 + - name: Build Doxygen Documentation + uses: mattnotmitt/doxygen-action@v1.9 + with: + working-directory: docs + - name: Upload HTML output as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 + with: + path: docs/doxygen/html + + deploy: + if: github.ref == 'refs/heads/develop' && github.repository_owner == 'alpaka-group' + permissions: + contents: read + pages: write + id-token: write + 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 diff --git a/.github/workflows/single-header.yml b/.github/workflows/single-header.yml index 8e2c004f89a..80eeabb6e27 100644 --- a/.github/workflows/single-header.yml +++ b/.github/workflows/single-header.yml @@ -19,6 +19,8 @@ jobs: run: | ./script/create-single-header.sh - name: commit + # run deployment only on the develop branch in the upstream repository + if: github.ref == 'refs/heads/develop' && github.repository_owner == 'alpaka-group' run: | set -x cd single-header diff --git a/script/install_doxygen.sh b/script/install_doxygen.sh deleted file mode 100755 index f99f784382c..00000000000 --- a/script/install_doxygen.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# -# Copyright 2020 Benjamin Worpitz -# SPDX-License-Identifier: MPL-2.0 -# - -set +xv -source ./script/setup_utilities.sh - -echo_green "" - -travis_retry sudo apt-get -y --quiet install --no-install-recommends doxygen graphviz diff --git a/script/push_doc.sh b/script/push_doc.sh deleted file mode 100755 index bef8e41d058..00000000000 --- a/script/push_doc.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# -# Copyright 2020 Benjamin Worpitz -# SPDX-License-Identifier: MPL-2.0 -# - -set +xv -source ./script/setup_utilities.sh - -echo_green "" - -cd docs/doxygen/html - -git config --global user.email "action@github.com" -git config --global user.name "GitHub Action" - -git add -f . - -git log -n 3 - -git diff --quiet && git diff --staged --quiet || (git commit -m "Update documentation skip-checks: true"; git push origin gh-pages) - -cd ../../../ diff --git a/script/run_doxygen.sh b/script/run_doxygen.sh deleted file mode 100755 index 8c5ceddc5f9..00000000000 --- a/script/run_doxygen.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# -# Copyright 2020 Benjamin Worpitz -# SPDX-License-Identifier: MPL-2.0 -# - -set +xv -source ./script/setup_utilities.sh - -echo_green "" - -#To deploy the doxygen documentation a copy of the repository is created inside the deployed folder. -#This copy is always in the gh-pages branch consisting only of the containing files. -#This folder is ignored in all other branches. -#*NOTE:* This has already been done once and does not have to be repeated! -#On working branch: -#- Add deploy directory to `.gitignore` (if not already done) -#- Create the `gh-pages` branch: `git checkout --orphan gh-pages` -#- Clean the branch: `git rm -rf .` -#- Commit and push the branch: `git add --all`, `git commit -m"add gh-pages branch"`, `git push` - -# Clone the gh-pages branch into the docs/doxygen/html folder. -git clone -b gh-pages https://x-access-token:${2}@github.com/${1}.git docs/doxygen/html - -cd docs/ - -rm -rf doxygen/html/* -rm -rf doxygen/xml/* - -doxygen Doxyfile - -cd ../