Skip to content

Commit

Permalink
updated gh-pages to use actions rather than force push to gh-pages br…
Browse files Browse the repository at this point in the history
…anch
  • Loading branch information
will-saunders-ukaea committed Apr 30, 2024
1 parent ed8436f commit cb8aabe
Showing 1 changed file with 48 additions and 21 deletions.
69 changes: 48 additions & 21 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
name: Build Docs


on:
push:
branches:
- main
- 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
Expand All @@ -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


0 comments on commit cb8aabe

Please sign in to comment.