Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish docs pr 2.x #2164

Merged
merged 34 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c5d4613
Altering workflow in GitHub Actions for building wiki2pages files.
gregharvey Jan 3, 2025
8476101
Attempting to set a hosts file for Ansible in CI.
gregharvey Jan 3, 2025
327db08
Trying to force Ansible host.
gregharvey Jan 3, 2025
b5d201a
Trying to force Ansible host.
gregharvey Jan 3, 2025
64530b1
Trying with an inventory file instead.
gregharvey Jan 3, 2025
a8ba1c4
Running Ansible as the 'ce-dev' user.
gregharvey Jan 3, 2025
9d8b47c
Fixing path to playbook.
gregharvey Jan 3, 2025
c87bbd0
Disabling host key checking.
gregharvey Jan 3, 2025
5bd801e
Disabling host checking in SSH.
gregharvey Jan 3, 2025
7f08219
Trying to use ce-dev user instead of root.
gregharvey Jan 3, 2025
f9e29fc
Fixing path to scripts.
gregharvey Jan 3, 2025
c120476
Adding some debug lines to check playbooks.
gregharvey Jan 3, 2025
caa1b90
Fixing workspace volume mount point.
gregharvey Jan 3, 2025
6366701
Trying a whole new /build location.
gregharvey Jan 3, 2025
15af1c3
Setting permissions on mounted disk.
gregharvey Jan 3, 2025
a5f04de
Checking ce-dev dir contents.
gregharvey Jan 3, 2025
6bc2055
Changing mount point to not destroy ce-dev files.
gregharvey Jan 3, 2025
c562607
Commenting permissions line.
gregharvey Jan 3, 2025
9502efe
Fixing playbook paths.
gregharvey Jan 3, 2025
88a7b12
Outputting hosts and SSH config for debug.
gregharvey Jan 3, 2025
084eaa3
Checking SSH settings.
gregharvey Jan 3, 2025
53b00d7
Manually creating authorized_keys.
gregharvey Jan 3, 2025
4e02937
Fixing path to set-current.
gregharvey Jan 3, 2025
36c0aeb
Refactoring SSH set-up and looking at set-current script.
gregharvey Jan 3, 2025
5c4d4eb
Trying to fix mount point.
gregharvey Jan 3, 2025
a16ec18
Updating paths to generated docs.
gregharvey Jan 3, 2025
5c83f82
Trying to pass in path to wiki2pages.
gregharvey Jan 3, 2025
a077a5f
Removing obsolete debug line.
gregharvey Jan 3, 2025
9ce237e
Correcting path to script.
gregharvey Jan 3, 2025
06c8b08
Changing path we execute from.
gregharvey Jan 3, 2025
0f8be8b
Adding first pass at docs publish step.
gregharvey Jan 6, 2025
cdb28c2
Repairing working dir paths.
gregharvey Jan 6, 2025
93751a4
Incorrect repo path.
gregharvey Jan 6, 2025
d8f3908
Removing most of the debug lines.
gregharvey Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 41 additions & 44 deletions .github/workflows/ce-provision-publish-docs.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,57 @@
name: Build docs
name: Publish docs

# Run this workflow when a PR to 1.x gets merged
# Run this workflow on demand and every time a new commit pushed to your repository
on:
pull_request:
types: [closed]
branches:
- 1.x
workflow_dispatch:

jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
build-docs:
public-docs:
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
# Name the Job
name: Build the documentation
name: Publish the ce-provision docs to GitHub
# 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
with:
fetch-depth: 0

# Configures global Git variables for committing
- name: Configure Git
- 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: Set up Ansible hosts file
run: |
mkdir -p /home/ce-dev/ansible/bin/hosts
echo "wikis2pages-hugo ansible_host=127.0.0.1" > /home/ce-dev/ansible/bin/hosts/hosts

- name: Set up SSH config
run: |
git config --global user.email "[email protected]"
git config --global user.name "Code Enigma CI"
git config --global pull.rebase false
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&

# Installs the ce-dev stack
- name: Install ce-dev
- name: Initialise wiki2pages for ce-provision 2.x
run: |
cd /tmp
wget https://golang.org/dl/go1.15.8.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.15.8.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

# Uses the ce-dev stack to run Hugo to format and deploy the docs
/usr/bin/su - ce-dev -c "cd /home/ce-dev/build/wiki2pages && /bin/sh init.sh --repo https://github.com/codeenigma/ce-provision.git --branch 2.x --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-provision-2.x --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/deploy.yml"
ls -la /home/ce-dev/build/wiki2pages/public/ce-provision-2.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-provision.git 1.x
/bin/sh set-current.sh ce-provision-1.x
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-provision-1.x
git remote add ci https://${{ secrets.DOCS_GITHUB_TOKEN }}@github.com/codeenigma/ce-provision-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-provision-2.x && /usr/bin/git remote add ci https://${{ secrets.DOCS_GITHUB_TOKEN }}@github.com/codeenigma/ce-provision-docs.git"
/usr/bin/su - ce-dev -c "cd /home/ce-dev/build/wiki2pages/public/ce-provision-2.x && /usr/bin/git push ci master"
1 change: 0 additions & 1 deletion ce-dev/ce-dev.compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.7"
x-ce_dev:
version: 1.x
registry: localhost:5000
Expand Down
Loading