Skip to content

Commit

Permalink
[#1137] Moved docs publishing to GHA.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Jan 13, 2024
1 parent eaffd46 commit 93dbd96
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 47 deletions.
47 changes: 0 additions & 47 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -616,40 +616,6 @@ jobs:
# the main workflow are separated from this one.
DREVOPS_CI_DB_CACHE_BRANCH: drevops-dev-didi-ii

#-----------------------------------------------------------------------------
# Publish docs to docs.drevops.com
# @todo Move this to GitHub Actions.
#-----------------------------------------------------------------------------
drevops-dev-deploy-docs:
<<: *runner_config
steps:
- checkout
- *step_process_codebase
- *step_setup_remote_docker
- *step_setup_docker_network
- add_ssh_keys:
fingerprints:
- "22:fe:71:f4:65:8d:cb:81:9c:31:09:4e:03:0b:33:b7"
- run:
name: Build and test docs
command: |
cd .drevops/docs
ahoy build
ahoy lint
ahoy test
- run:
name: Publish docs
command: |
cd .drevops/docs
export DOCS_PUBLISH_REMOTE_URL=https://github.com/drevops/drevops_docs.git
export DOCS_PUBLISH_SRC_TAG=${CIRCLE_TAG:-}
export DOCS_PUBLISH_SRC_BRANCH=${CIRCLE_BRANCH:-}
export DOCS_PUBLISH_SSH_FINGERPRINT="22:fe:71:f4:65:8d:cb:81:9c:31:09:4e:03:0b:33:b7"
export DOCS_PUBLISH_CANARY_BRANCH="develop"
export DOCS_PUBLISH_COMMIT_MESSAGE="Automatically pushed from drevops/drevops"
export DOCS_PUBLISH_GIT_EMAIL="[email protected]"
./.utils/publish.sh
#-----------------------------------------------------------------------------
# Publish installer to install.drevops.com
# @todo Move this to GitHub Actions.
Expand Down Expand Up @@ -810,19 +776,6 @@ workflows:
tags:
only: /^[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$/

# Build and publish DrevOps docs.
- drevops-dev-deploy-docs:
requires:
- build
- drevops-dev-test
- drevops-dev-test-workflow
filters:
branches:
# 'main' or any branch with 'docs' in the name.
only: /^main$|^develop$|.*docs.*/
tags:
only: /^[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$/

# Publish DrevOps installer.
- drevops-dev-deploy-installer:
requires:
Expand Down
3 changes: 3 additions & 0 deletions .drevops/installer/src/Command/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,9 @@ protected function processDrevopsInternal($dir) {
static::rmdirRecursive("$dir/.drevops/tests");
static::rmdirRecursive("$dir/scripts/drevops/utils");
@unlink("$dir/.github/FUNDING.yml");
foreach (glob("$dir/.github/drevops-*.yml") as $file) {
@unlink($file);
}

// Remove other unhandled tokenized comments.
$this->removeTokenLine('#;<', $dir);
Expand Down
1 change: 1 addition & 0 deletions .drevops/tests/bats/_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ assert_files_present_drevops() {
assert_dir_not_exists ".drevops"
assert_file_not_exists "LICENSE"
assert_file_not_exists ".github/FUNDING.yml"
assert_file_not_exists ".github/drevops-publish-docs.yml"
assert_file_not_contains ".circleci/config.yml" "drevops-dev-test"
assert_file_not_contains ".circleci/config.yml" "drevops-dev-test-workflow"
assert_file_not_contains ".circleci/config.yml" "drevops-dev-test-deployment"
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/drevops-publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This action is used for DrevOps maintenance. It will not be used in the scaffolded project.
name: Publish documentation to GitHub Pages for DrevOps

on:
push:
tags:
- /^[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$/
branches:
- /^main$|^develop$|.*docs.*/

jobs:
publish-docs:
runs-on: drevops/ci-runner:23.12.0

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup SSH private key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DOCS_PUBLISH_SSH_PRIVATE_KEY }}
name: id_rsa_docs_publish_ssh_private_key
known_hosts: github.com

- name: Build and test docs
run: |
cd .drevops/docs
ahoy build
ahoy lint
ahoy test
- name: Publish docs
run: |
cd .drevops/docs
export DOCS_PUBLISH_REMOTE_URL=https://github.com/drevops/drevops_docs.git
export DOCS_PUBLISH_SRC_TAG=${CIRCLE_TAG:-}
export DOCS_PUBLISH_SRC_BRANCH=${CIRCLE_BRANCH:-}
export DOCS_PUBLISH_SSH_FILE="~/.ssh/id_rsa_docs_publish_ssh_private_key"
export DOCS_PUBLISH_CANARY_BRANCH="develop"
export DOCS_PUBLISH_COMMIT_MESSAGE="Automatically pushed from drevops/drevops"
export DOCS_PUBLISH_GIT_EMAIL="[email protected]"
./.utils/publish.sh

0 comments on commit 93dbd96

Please sign in to comment.