Skip to content

Fix GitHub Pages deployment workflow #2

Fix GitHub Pages deployment workflow

Fix GitHub Pages deployment workflow #2

Workflow file for this run

name: GitHub Pages
on:
push:
branches:
- main
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Create gh-pages structure
run: |
# Create the directory structure for GitHub Pages
mkdir -p gh-pages
# Copy the DocC documentation to the root of the GitHub Pages site
cp -r docs/* gh-pages/ || echo "No docs directory found"
# Copy our landing page as the index.html if it exists
if [ -f "landing-page.html" ]; then
cp landing-page.html gh-pages/index.html
elif [ -f "index.html" ]; then
cp index.html gh-pages/index.html
fi
# Create .nojekyll file to disable Jekyll processing
touch gh-pages/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './gh-pages'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4