Skip to content

Merge pull request #7975 from kenjis/fix-response.rst-method-names #985

Merge pull request #7975 from kenjis/fix-response.rst-method-names

Merge pull request #7975 from kenjis/fix-response.rst-method-names #985

# When changes are pushed to the develop branch,
# build the current version of the User Guide
# with Sphinx and deploy it to the gh-pages branch.
#
# @todo Consolidate checkouts
name: Deploy User Guide (latest)
on:
push:
branches:
- 'develop'
paths:
- 'user_guide_src/**'
permissions:
contents: read
jobs:
build:
name: Deploy to gh-pages
permissions:
# Allow ad-m/github-push-action to push commit to branch gh-pages
contents: write
if: (github.repository == 'codeigniter4/CodeIgniter4')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none
# Build the latest User Guide
- name: Build with Sphinx
uses: ammaraskar/sphinx-action@0.4
with:
docs-folder: user_guide_src/
- name: Add "Edit this page" links
run: |
cd user_guide_src
# Fix permissions
sudo chown -R runner:docker build/html/
php add-edit-this-page build/html/
# Create an artifact of the html output
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: HTML Documentation
path: user_guide_src/build/html/
# Commit changes to the gh-pages branch
- name: Commit changes
run: |
git clone https://github.com/codeigniter4/CodeIgniter4.git --branch gh-pages --single-branch gh-pages
cp -r user_guide_src/build/html/* gh-pages/
cd gh-pages
git config --local user.email "action@github.com"
git config --local user.name "${GITHUB_ACTOR}"
git add .
# Ignore failures due to lack of changes
git commit -m "Update User Guide" -a || true
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.ACCESS_TOKEN }}