diff --git a/.github/workflows/ce-deploy-publish-docs.yml b/.github/workflows/ce-deploy-publish-docs.yml index 45148600..df31e516 100644 --- a/.github/workflows/ce-deploy-publish-docs.yml +++ b/.github/workflows/ce-deploy-publish-docs.yml @@ -1,11 +1,12 @@ name: Publish documentation -# Run this workflow every time a new commit pushed to your repository +# Run this workflow on demand or every time a PR is accepted to a main branch on: pull_request: types: [closed] branches: - 1.x + workflow_dispatch: jobs: # Set the job key. The key is displayed as the job name @@ -14,51 +15,54 @@ jobs: # Name the Job name: Publish ce-deploy documentation # Set the type of machine to run on - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest + + # Use our ce-dev Debian base container + container: + image: codeenigma/ce-dev-controller:2.x + volumes: + - ${{ github.workspace }}:/home/controller steps: - # Checks out a copy of your repository on the ubuntu-latest machine - - name: Checkout code - uses: actions/checkout@v2 + - name: Install wiki2pages + run: /usr/bin/su - ce-dev -c "/usr/bin/git clone https://github.com/codeenigma/wikis2pages.git /home/ce-dev/build/wiki2pages" + + - name: Update local applications + run: | + /usr/bin/su - ce-dev -c "cd /home/ce-dev/ce-provision && /usr/bin/git pull origin 2.x" + /usr/bin/su - ce-dev -c "cd /home/ce-dev/ce-deploy && /usr/bin/git pull origin 1.x" - # Configures global Git variables for committing - - name: Configure Git + - name: Set up Ansible hosts file run: | - git config --global user.email "sysadm@codeenigma.com" - git config --global user.name "Code Enigma CI" + mkdir -p /home/ce-dev/ansible/bin/hosts + echo "wikis2pages-hugo ansible_host=127.0.0.1" > /home/ce-dev/ansible/bin/hosts/hosts - # Installs the ce-dev stack - - name: Install ce-dev + - name: Set up SSH config run: | - cd /tmp - wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz - sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz - export PATH=$PATH:/usr/local/go/bin - git clone https://github.com/FiloSottile/mkcert && cd mkcert - go build -ldflags "-X main.Version=$(git describe --tags)" - sudo mv ./mkcert /usr/local/bin && cd ../ - sudo chmod +x /usr/local/bin/mkcert - rm -Rf mkcert - curl -sL https://raw.githubusercontent.com/codeenigma/ce-dev/1.x/install.sh | /bin/sh -s -- linux + echo "StrictHostKeyChecking=no" > /home/ce-dev/.ssh/config + cat /home/ce-dev/.ssh/id_rsa.pub > /home/ce-dev/.ssh/authorized_keys + chown ce-dev:ce-dev /home/ce-dev/.ssh/config + chmod 700 /home/ce-dev/.ssh/config + chown ce-dev:ce-dev /home/ce-dev/.ssh/authorized_keys + chmod 700 /home/ce-dev/.ssh/authorized_keys + + - name: Start SSHD + run: /usr/sbin/sshd& - # Builds the table of contents for the docs - - name: Documentation (build table of contents) - if: ${{ github.event.pull_request.base.ref == '1.x' }} - run: contribute/toc.sh - shell: bash + - name: Initialise wiki2pages for ce-deploy ${{ github.event.pull_request.base.ref }} + run: | + /usr/bin/su - ce-dev -c "cd /home/ce-dev/build/wiki2pages && /bin/sh init.sh --repo https://github.com/codeenigma/ce-deploy.git --branch ${{ github.event.pull_request.base.ref }} --no-ce-dev" + /usr/bin/su - ce-dev -c "cd /home/ce-dev/build/wiki2pages && /home/ce-dev/ansible/bin/ansible-playbook -e 'wiki2pages_build_path=/home/ce-dev/build/wiki2pages' -i /home/ce-dev/ansible/bin/hosts /home/ce-dev/build/wiki2pages/ce-dev/ansible/provision.yml" + /usr/bin/su - ce-dev -c "cd /home/ce-dev/build/wiki2pages && /bin/sh set-current.sh --project ce-deploy-${{ github.event.pull_request.base.ref }} --no-ce-dev" + /usr/bin/su - ce-dev -c "cd /home/ce-dev/build/wiki2pages && /home/ce-dev/ansible/bin/ansible-playbook -e 'wiki2pages_build_path=/home/ce-dev/build/wiki2pages launch_hugo_server=false' -i /home/ce-dev/ansible/bin/hosts /home/ce-dev/build/wiki2pages/ce-dev/ansible/deploy.yml" + + - name: Run Hugo + run: | + /usr/bin/su - ce-dev -c "cd /home/ce-dev/build/wiki2pages && hugo" + ls -la /home/ce-dev/build/wiki2pages/public/ce-deploy-${{ github.event.pull_request.base.ref }}/ - # Uses the ce-dev stack to run Hugo to build and deploy the docs - - name: Documentation (build and publish) - if: ${{ github.event.pull_request.base.ref == '1.x' }} + - name: Publish documentation run: | - cd - git clone https://github.com/codeenigma/wikis2pages.git - cd wikis2pages - /bin/bash init.sh https://${{ secrets.GITHUB_TOKEN }}@github.com/codeenigma/ce-deploy.git 1.x - /bin/sh set-current.sh ce-deploy-1.x-travis - docker exec --user ce-dev --workdir /home/ce-dev/deploy/live.local wikis2pages-hugo hugo - /bin/sh .github-actions-push.sh - cd /home/runner/wikis2pages/public/ce-deploy-1.x-travis - git remote add ci https://${{ secrets.DOCS_GITHUB_TOKEN }}@github.com/codeenigma/ce-deploy-docs.git - git push ci master - shell: bash + /usr/bin/su - ce-dev -c "cd /home/ce-dev/build/wiki2pages && /bin/sh /home/ce-dev/build/wiki2pages/.github-actions-push.sh" + /usr/bin/su - ce-dev -c "cd /home/ce-dev/build/wiki2pages/public/ce-deploy-${{ github.event.pull_request.base.ref }} && /usr/bin/git remote add ci https://${{ secrets.DOCS_GITHUB_TOKEN }}@github.com/codeenigma/ce-deploy-docs.git" + /usr/bin/su - ce-dev -c "cd /home/ce-dev/build/wiki2pages/public/ce-deploy-${{ github.event.pull_request.base.ref }} && /usr/bin/git push ci master" diff --git a/contribute/toc.sh b/contribute/toc.sh index face006c..8dc9a1c8 100755 --- a/contribute/toc.sh +++ b/contribute/toc.sh @@ -114,7 +114,7 @@ parse_roles_toc(){ "# "*) if [ "$WRITE" = "true" ]; then TITLE=$(echo "$LINE" | cut -c 3-) - echo "$INDENT"" - [$TITLE](/$RELATIVE)" >> "$TMP_SIDEBAR" + echo "$INDENT"" - [$TITLE]($RELATIVE)" >> "$TMP_SIDEBAR" WRITE="false" fi ;; @@ -137,4 +137,4 @@ generate_roles_toc cp_single_page install cp_single_page contribute -cp_single_page scripts \ No newline at end of file +cp_single_page scripts diff --git a/docs/_Sidebar.md b/docs/_Sidebar.md index b1f28b08..a50bee09 100644 --- a/docs/_Sidebar.md +++ b/docs/_Sidebar.md @@ -1,50 +1,49 @@   -- [Home](/) - - [Install](/install) - - [Usage](/scripts) +- [Home]() + - [Install](install) + - [Usage](scripts) - [Roles](roles) - - [API call](/roles/api_call) - - [Config](/roles/cache_clear) - - [Drupal 7](/roles/cache_clear/cache_clear-drupal7) - - [Drupal 8](/roles/cache_clear/cache_clear-drupal8) - - [Matomo](/roles/cache_clear/cache_clear-matomo) - - [Drupal 8](/roles/cache_clear/cache_clear-mautic) - - [Opcache](/roles/cache_clear/cache_clear-opcache) - - [Symfony](/roles/cache_clear/cache_clear-symfony) - - [ce-dev](/roles/ce_dev) - - [ce-dev prebuild](/roles/ce_dev/ce_dev_prebuild) - - [CLI Tools](/roles/cli) - - [Drush](/roles/cli/cachetool) - - [Drush](/roles/cli/drush) - - [Composer](/roles/composer) - - [Config](/roles/config_generate) - - [Drupal 7](/roles/config_generate/config_generate-drupal7) - - [Drupal 8](/roles/config_generate/config_generate-drupal8) - - [Drupal 8](/roles/config_generate/config_generate-matomo) - - [Mautic](/roles/config_generate/config_generate-mautic) - - [Cron](/roles/cron) - - [Database backup cron task](/roles/cron/cron_database_backup) - - [Database backup cron task - MySQL](/roles/cron/cron_database_backup/cron_database_backup-mysql) - - [Drupal 7 cron](/roles/cron/cron_drupal7) - - [Drupal 8 cron](/roles/cron/cron_drupal8) - - [Database backup cron task - MySQL](/roles/cron/cron_matomo) - - [Mautic cron tasks](/roles/cron/cron_mautic) - - [Data backups](/roles/database_backup) - - [MySQL backups](/roles/database_backup/database_backup-mysql) - - [Deploy](/roles/deploy_code) - - [Deploy container](/roles/deploy_container) - - [Exit](/roles/_exit) - - [Init](/roles/_init) - - [LHCI run](/roles/lhci_run) - - [Maintenance Mode](/roles/maintenance_mode) - - ["Meta"](/roles/_meta) - - [Drupal 10](/roles/_meta/deploy-drupal10) - - [Drupal 7](/roles/_meta/deploy-drupal7) - - [Drupal 8](/roles/_meta/deploy-drupal8) - - [Matomo](/roles/_meta/deploy-matomo) - - [Mautic](/roles/_meta/deploy-mautic) - - [SimpleSAMLphp](/roles/_meta/deploy-simplesamlphp) - - [NPM](/roles/npm) - - [Sync roles](/roles/sync) - - [Database sync](/roles/sync/database_sync) - - [Database sync - MySQL](/roles/sync/database_sync/database_sync-mysql) + - [API call](roles/api_call) + - [Config](roles/cache_clear) + - [Drupal 7](roles/cache_clear/cache_clear-drupal7) + - [Drupal 8](roles/cache_clear/cache_clear-drupal8) + - [Matomo](roles/cache_clear/cache_clear-matomo) + - [Opcache](roles/cache_clear/cache_clear-opcache) + - [Symfony](roles/cache_clear/cache_clear-symfony) + - [ce-dev](roles/ce_dev) + - [ce-dev prebuild](roles/ce_dev/ce_dev_prebuild) + - [CLI Tools](roles/cli) + - [Drush](roles/cli/cachetool) + - [Drush](roles/cli/drush) + - [Composer](roles/composer) + - [Config](roles/config_generate) + - [Drupal 7](roles/config_generate/config_generate-drupal7) + - [Drupal 8](roles/config_generate/config_generate-drupal8) + - [Drupal 8](roles/config_generate/config_generate-matomo) + - [Mautic](roles/config_generate/config_generate-mautic) + - [Cron](roles/cron) + - [Database backup cron task](roles/cron/cron_database_backup) + - [Database backup cron task - MySQL](roles/cron/cron_database_backup/cron_database_backup-mysql) + - [Drupal 7 cron](roles/cron/cron_drupal7) + - [Drupal 8 cron](roles/cron/cron_drupal8) + - [Database backup cron task - MySQL](roles/cron/cron_matomo) + - [Mautic cron tasks](roles/cron/cron_mautic) + - [Data backups](roles/database_backup) + - [MySQL backups](roles/database_backup/database_backup-mysql) + - [Deploy](roles/deploy_code) + - [Deploy container](roles/deploy_container) + - [Exit](roles/_exit) + - [Init](roles/_init) + - [LHCI run](roles/lhci_run) + - [Maintenance Mode](roles/maintenance_mode) + - ["Meta"](roles/_meta) + - [Drupal 10](roles/_meta/deploy-drupal10) + - [Drupal 7](roles/_meta/deploy-drupal7) + - [Drupal 8](roles/_meta/deploy-drupal8) + - [Matomo](roles/_meta/deploy-matomo) + - [Mautic](roles/_meta/deploy-mautic) + - [SimpleSAMLphp](roles/_meta/deploy-simplesamlphp) + - [NPM](roles/npm) + - [Sync roles](roles/sync) + - [Database sync](roles/sync/database_sync) + - [Database sync - MySQL](roles/sync/database_sync/database_sync-mysql) diff --git a/docs/roles/cache_clear/cache_clear-mautic.md b/docs/roles/cache_clear/cache_clear-mautic.md deleted file mode 100644 index 16360291..00000000 --- a/docs/roles/cache_clear/cache_clear-mautic.md +++ /dev/null @@ -1,7 +0,0 @@ -# Drupal 8 -Clear caches for Drupal 8. - - - - -