Merge pull request #299 from mwarusz/omega/hipar-kokkos-wrappers #101
This file contains hidden or 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: omega-release | |
| on: | |
| push: | |
| branches: [develop] | |
| # But only if Omega docs-related files are touched | |
| paths: | |
| - components/omega/doc/** | |
| env: | |
| PYTHON_VERSION: "3.13" | |
| jobs: | |
| publish-docs: | |
| if: ${{ github.repository == 'E3SM-Project/E3SM' }} or \ | |
| ${{ github.repository == 'E3SM-Project/Omega' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Set up Conda Environment | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| activate-environment: "omega_ci" | |
| miniforge-version: latest | |
| channels: conda-forge | |
| channel-priority: strict | |
| auto-update-conda: true | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| conda create -n omega_dev --file components/omega/dev-conda.txt \ | |
| python=${{ env.PYTHON_VERSION }} | |
| conda activate omega_dev | |
| conda list | |
| - name: Build Omega Docs with Sphinx | |
| # Use 'make html' (not html-strict) so docs always update, even if warnings exist. | |
| run: | | |
| conda activate omega_dev | |
| cd components/omega/doc | |
| make html | |
| - name: Copy Docs and Commit | |
| run: | | |
| conda activate omega_dev | |
| cd components/omega/doc | |
| # gh-pages branch must already exist | |
| git clone https://github.com/${{ github.repository }}.git --branch gh-pages --single-branch gh-pages | |
| # Make sure we're in the gh-pages directory. | |
| cd gh-pages | |
| # Replace `Omega` docs with latest changes | |
| rm -rf Omega | |
| mkdir Omega | |
| cp -r ../_build/html/* Omega/ | |
| # Configure git using GitHub Actions credentials. | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| # The second command will fail if no changes were present, so we ignore it | |
| git add . | |
| git commit -m "Update documentation" -a || true | |
| - name: Push Changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| branch: gh-pages | |
| directory: components/omega/doc/gh-pages | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| force: true |