diff --git a/.github/scripts/deploy-userguide b/.github/scripts/deploy-userguide index abbb768a5017..b67c1da94c13 100755 --- a/.github/scripts/deploy-userguide +++ b/.github/scripts/deploy-userguide @@ -23,6 +23,12 @@ cd $TARGET git checkout master rm -rf docs +# Copy common files +cp -Rf ${SOURCE}/LICENSE ./ + +# Copy repo-specific files +cp -Rf ${SOURCE}/admin/userguide/. ./ + # Copy files cp -Rf ${SOURCE}/user_guide_src/build/html ./docs cp -Rf ${SOURCE}/user_guide_src/build/epub/CodeIgniter.epub ./CodeIgniter${VERSION}.epub diff --git a/admin/userguide/.github/scripts/deploy b/admin/userguide/.github/scripts/deploy new file mode 100755 index 000000000000..0347c004dfff --- /dev/null +++ b/admin/userguide/.github/scripts/deploy @@ -0,0 +1,15 @@ +#!/bin/sh -e + +# Deploys the User Guide to the production +# website. Triggered by updates to the GitHub +# repo's master branch. + +REPO=/opt/userguide +SITE=/home/public_html/userguides/userguide4 + +cd "$REPO" +git switch master +git pull + +rm -rf "$SITE" +cp -R "$REPO/docs" "$SITE" diff --git a/admin/userguide/.github/workflows/deploy.yml b/admin/userguide/.github/workflows/deploy.yml new file mode 100644 index 000000000000..ac8027fc7410 --- /dev/null +++ b/admin/userguide/.github/workflows/deploy.yml @@ -0,0 +1,22 @@ +# Deploys the User Guide to the production +# website whenever master branch is updated +name: Deploy Production + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: executing remote ssh commands using ssh key + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script: /opt/userguide/.github/scripts/deploy diff --git a/admin/userguide/.gitignore b/admin/userguide/.gitignore new file mode 100644 index 000000000000..d0eba7f4bdaa --- /dev/null +++ b/admin/userguide/.gitignore @@ -0,0 +1,13 @@ +*/config/development +*/logs/log-*.php +!*/logs/index.html +*/cache/* +!*/cache/index.html +!*/cache/.htaccess + +user_guide_src/build/* +user_guide_src/cilexer/build/* +user_guide_src/cilexer/dist/* +user_guide_src/cilexer/pycilexer.egg-info/* + +/vendor/ diff --git a/admin/userguide/README.md b/admin/userguide/README.md index 10d85692bc38..0ea07075db61 100644 --- a/admin/userguide/README.md +++ b/admin/userguide/README.md @@ -1,20 +1,15 @@ # CodeIgniter 4 User Guide -## What is CodeIgniter? - -CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure. +CodeIgniter 4 is a PHP web framework that is light, fast, flexible, and secure. More information can be found at the [official site](http://codeigniter.com). -This repository holds a composer-installable pre-built user guide for the framework. -It has been built from the -[development repository](https://github.com/codeigniter4/CodeIgniter4). - -More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums. - -## Installation & updates +**This is a read-only repository used to publish the user guide for the current release.** +It is built automatically as part of the framework release workflow, and pull +requests are not accepted here. -`composer require codeigniter4/userguide` will install a copy -of the user guide inside your project, at -`vendor/codeigniter4/userguide`. You can then `composer update` whenever -there is a new release of the framework. +Development is done in the [main repository](https://github.com/codeigniter4/codeigniter4). +If you find problems with the user guide, please submit a correcting pull request there. +If you feel that features are missing or unclear, please comment on our +[forum](https://forum.codeigniter.com/index.php), +in the appropriate CodeIgniter4 subforum. diff --git a/admin/userguide/composer.json b/admin/userguide/composer.json deleted file mode 100644 index 007664b9b2ec..000000000000 --- a/admin/userguide/composer.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "codeigniter4/userguide", - "type": "project", - "description": "CodeIgniter4 user guide", - "homepage": "https://codeigniter.com", - "license": "MIT", - "require": { - "php": "^7.4 || ^8.0", - "codeigniter4/framework": "^4" - }, - "support": { - "forum": "https://forum.codeigniter.com/", - "source": "https://github.com/codeigniter4/CodeIgniter4", - "slack": "https://codeigniterchat.slack.com" - } -}