Skip to content

Commit b228621

Browse files
zhuravelsergii.kostiuk
andauthored
[PR-25811] Self-hosted CI (#420)
Co-authored-by: sergii.kostiuk <sergii.kostiuk@talkable.com>
1 parent ce7ca96 commit b228621

File tree

6 files changed

+249
-200
lines changed

6 files changed

+249
-200
lines changed

.circleci/config.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
push:
9+
branches:
10+
- master
11+
- staging
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: ${{ contains(fromJSON('["master", "staging"]'), github.ref_name) }}
17+
18+
jobs:
19+
build:
20+
runs-on: runs-on=${{ github.run_id }}/cpu=1+32/ram=1+32/family=m8+c8+r8+i8+m7+c7+r7+t4/image=ubuntu22-full-arm64/spot=lowest-price/extras=s3-cache
21+
22+
env:
23+
ENVIRONMENT: production
24+
25+
steps:
26+
- uses: runs-on/action@v2
27+
with:
28+
# See https://github.com/runs-on/action#options
29+
metrics: cpu,memory
30+
show_costs: summary
31+
show_env: false
32+
33+
- name: Checkout code
34+
uses: actions/checkout@v5
35+
36+
- name: Setup Python
37+
uses: actions/setup-python@v6
38+
with:
39+
python-version: '3.12'
40+
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v7
43+
with:
44+
enable-cache: true
45+
46+
- name: Install dependencies
47+
working-directory: sphinx
48+
run: uv sync
49+
50+
- name: Build documentation
51+
working-directory: sphinx
52+
run: uv run sphinx-build -nW -b dirhtml -d build/doctrees ../source build/html

deploy/Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pipeline {
55
label "staging"
66
}
77
environment {
8-
CIRCLE_CI_TOKEN = credentials('CIRCLE_CI_TOKEN')
8+
GITHUB_ACC = credentials('talkable-bot-deploy-token')
99
JENKINS_BUILD_USER_ID = ""
1010
LOCAL_PORT="8080"
1111
SLACK_CHANNEL = "deploy"
@@ -18,7 +18,7 @@ pipeline {
1818
parameters {
1919
choice(name: "DEPLOY_COMMAND",
2020
choices: ["deploy", "ci_status"],
21-
description: "DEPLOY - Start the default deployment\nCI_STATUS - Check the CircleCI build status")
21+
description: "DEPLOY - Start the default deployment\nCI_STATUS - Check the GitHub Actions build status")
2222
}
2323
options {
2424
buildDiscarder(logRotator(numToKeepStr: '15', daysToKeepStr: '14'))

deploy/deploy.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ printenv | sort
88
TIMEFRAME_SECONDS=240
99
PROJECT_ROOT="talkable-docs"
1010
SUBPROJECT="docs"
11-
# CircleCI API v2 configuration
12-
CIRCLE_CI_API_BASE="https://circleci.com/api/v2"
13-
CIRCLE_CI_PROJECT_SLUG="gh/talkable/${PROJECT_ROOT}"
14-
CIRCLE_CI_WEB_URL="https://app.circleci.com/pipelines/github/talkable/${PROJECT_ROOT}?branch=${BRANCH_NAME}"
11+
# GitHub Actions configuration
12+
GITHUB_API_BASE="https://api.github.com"
13+
GITHUB_REPOSITORY="talkable/${PROJECT_ROOT}"
14+
GITHUB_ACTIONS_WEB_URL="https://github.com/talkable/${PROJECT_ROOT}/actions?query=branch%3A${BRANCH_NAME}"
1515

16-
# Source shared CircleCI functions
16+
# Source shared GitHub Actions functions
1717
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
18-
source "${SCRIPT_DIR}/lib/circleci_common.sh"
18+
source "${SCRIPT_DIR}/lib/github_actions_common.sh"
1919

2020
TASK=$1
2121

@@ -24,14 +24,14 @@ print_help() {
2424
clear
2525
echo 'Available Commands:'
2626
echo ' deploy - deploy current version of talkable-docs'
27-
echo ' ci | cistatus | status - check CircleCI build status'
27+
echo ' ci | cistatus | status - check GitHub Actions build status'
2828
echo 'Example:'
2929
echo ' deploy.sh deploy'
3030
echo ' deploy.sh ci_status'
3131
exit 0
3232
}
3333

34-
# CircleCI status function is now sourced from lib/circleci_common.sh
34+
# GitHub Actions status function is now sourced from lib/github_actions_common.sh
3535

3636
remote_ssh_exec() {
3737
ssh -o StrictHostKeyChecking=no -i "$SSH_KEY" "$SSH_USER@$HOST_ENV" "$@"
@@ -62,12 +62,12 @@ EOF
6262

6363
case $TASK in
6464
ci | ci_status | ci_only | status)
65-
circleci_status
65+
gh_status
6666
deploy_check
6767
;;
6868
deploy)
6969
echo "Starting deployment..."
70-
circleci_status
70+
gh_status
7171
deploy_docs
7272
deploy_check
7373
;;

deploy/lib/circleci_common.sh

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)