diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml index 2a5fb078..8edf4738 100644 --- a/.github/workflows/build_docs.yaml +++ b/.github/workflows/build_docs.yaml @@ -1,4 +1,6 @@ name: Build Docs + + on: push: branches: @@ -6,12 +8,29 @@ on: - dev tags: - v* + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v2 - name: Install Sphinx/Doxygen run: | sudo apt update @@ -32,24 +51,32 @@ jobs: cp -r ./build/* /tmp/gh-pages/. touch /tmp/gh-pages/.nojekyll ls /tmp/gh-pages - - name: Push Website - working-directory: /tmp/gh-pages - env: - GH_DOCS_WEBSITE_PUSH_KEY: ${{secrets.GH_DOCS_WEBSITE_PUSH_KEY}} - run: | - git init - git remote -v - git remote add origin git@github.com:ExCALIBUR-NEPTUNE/NESO-Particles.git - git checkout -b gh-pages - git add * - git add .nojekyll - git status - git config --global user.email "GitHubActions" - git config --global user.name "Github Actions" - git commit -am "generated website: $(date)" - export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" - eval `ssh-agent -s` - echo "$GH_DOCS_WEBSITE_PUSH_KEY" > /tmp/id_rsa - chmod 600 /tmp/id_rsa - ssh-add /tmp/id_rsa - git push origin gh-pages --force + - uses: actions/upload-artifact@master + with: + name: gh-page + path: /tmp/gh-pages + if-no-files-found: error + + # Deployment job + deploy: + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/download-artifact@master + with: + name: gh-page + path: /tmp/gh-pages + - uses: actions/configure-pages@v1 + - uses: actions/upload-pages-artifact@v1 + with: + path: /tmp/gh-pages + - id: deployment + uses: actions/deploy-pages@main + +