Skip to content

Commit c94a92d

Browse files
committed
feat: auto deploy the docs and sites
1 parent 8603a17 commit c94a92d

File tree

8 files changed

+287
-3
lines changed

8 files changed

+287
-3
lines changed

.github/config/labels.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
- name: bug
2+
description: Something isn't working
3+
color: d73a4a
4+
- name: doc
5+
description: Improvements to documentation
6+
color: d4c5f9
7+
- name: duplicate
8+
description: This issue or pull request already exists
9+
color: cfd3d7
10+
- name: feature
11+
color: 1d76db
12+
description: New features
13+
- name: enhancement
14+
description: Enhancement of existing functionality
15+
color: 84b6eb
16+
- name: deprecated
17+
description: Deprecating API
18+
color: f4c21d
19+
- name: removed
20+
description: Removing API
21+
color: e4b21d
22+
- name: tests
23+
description: Enhancement of tests
24+
color: 0e8a16
25+
- name: java
26+
description: Java/JDK changes
27+
color: 03d0d6
28+
- name: gradle
29+
description: Gradle changes
30+
color: d0d603
31+
- name: maven
32+
description: Maven changes
33+
color: d60366
34+
- name: compose
35+
description: Jetbrains Compose issues
36+
color: 3cdc84
37+
- name: help
38+
description: Help Wanted
39+
color: 0e8a16
40+
- name: question
41+
description: Questions and discussions
42+
color: cc317c
43+
- name: dependencies
44+
description: Changes that affect dependencies
45+
color: 5319e7
46+
- name: docker
47+
description: Container changes
48+
color: e99695
49+
- name: github-actions
50+
description: Github action workflow changes
51+
color: ff7619
52+
- name: graalvm
53+
description: GraalVM changes
54+
color: 387E65
55+
- name: native-image
56+
description: GraalVM native-image changes
57+
color: A720DE
58+
- name: kotlin
59+
description: Kotlin changes
60+
color: 5319E7
61+
- name: kotlin-kmp
62+
description: Kotlin Multiplatform changes
63+
color: 7f52ff
64+
- name: kotlin-multiplatform
65+
description: Kotlin Multiplatform changes
66+
color: 7f52ff

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
open-pull-requests-limit: 5
8+
labels:
9+
- "github-actions"
10+
- "dependencies"
11+
reviewers:
12+
- sureshg
13+
14+
- package-ecosystem: "docker"
15+
directory: "/"
16+
schedule:
17+
interval: "daily"
18+
labels:
19+
- "docker"
20+
- "dependencies"

.github/workflows/build-docs.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Build documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
workflow_dispatch:
10+
11+
permissions:
12+
id-token: write
13+
pages: write
14+
contents: write
15+
issues: write
16+
packages: write
17+
repository-projects: write
18+
19+
env:
20+
INSTANCE: 'Writerside/n'
21+
ARTIFACT: 'webHelpN2-all.zip'
22+
DOCKER_VERSION: '233.14938'
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Build docs using Writerside Docker builder
32+
uses: JetBrains/writerside-github-action@v4
33+
with:
34+
instance: ${{ env.INSTANCE }}
35+
artifact: ${{ env.ARTIFACT }}
36+
docker-version: ${{ env.DOCKER_VERSION }}
37+
38+
- name: Save artifact with build results
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: docs
42+
path: |
43+
artifacts/${{ env.ARTIFACT }}
44+
artifacts/report.json
45+
retention-days: 7
46+
47+
test:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Download artifacts
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: docs
55+
path: artifacts
56+
57+
- name: Test documentation
58+
uses: JetBrains/writerside-checker-action@v1
59+
with:
60+
instance: ${{ env.INSTANCE }}
61+
62+
deploy:
63+
needs: [ build, test ]
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Download artifacts
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: docs
70+
71+
- name: Unzip artifact
72+
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d notesDir
73+
74+
- name: 🚀 Deploy notes
75+
uses: JamesIves/github-pages-deploy-action@v4.5.0
76+
with:
77+
branch: main
78+
folder: notesDir
79+
target-folder: notes
80+
clean: true
81+
commit-message: 'Deployed notes!'
82+
83+
# - name: Setup Pages
84+
# uses: actions/configure-pages@v4
85+
#
86+
# - name: Package and upload Pages artifact
87+
# uses: actions/upload-pages-artifact@v3
88+
# with:
89+
# path: dir
90+
#
91+
# - name: Deploy to GitHub Pages
92+
# id: deployment
93+
# uses: actions/deploy-pages@v4
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Dependabot auto-approve
2+
3+
on: pull_request_target
4+
5+
permissions: write-all
6+
7+
jobs:
8+
dependabot:
9+
runs-on: ubuntu-latest
10+
if: github.actor == 'dependabot[bot]'
11+
steps:
12+
- name: 🔧Dependabot metadata
13+
id: dependabot-metadata
14+
uses: dependabot/fetch-metadata@v1.6.0
15+
with:
16+
github-token: "${{ secrets.GITHUB_TOKEN }}"
17+
18+
- name: Approve a PR
19+
run: gh pr review --approve "$PR_URL"
20+
env:
21+
PR_URL: ${{github.event.pull_request.html_url}}
22+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
23+
24+
- name: Enable auto-merge for Dependabot PRs
25+
if: steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major'
26+
run: gh pr merge --auto --merge "$PR_URL"
27+
env:
28+
PR_URL: ${{github.event.pull_request.html_url}}
29+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
30+
31+
- name: Add a label for dependencies
32+
if: steps.dependabot-metadata.outputs.dependency-type == 'direct:production'
33+
run: gh pr edit "$PR_URL" --add-label "dependencies"
34+
env:
35+
PR_URL: ${{github.event.pull_request.html_url}}
36+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/sync-labels.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Sync labels
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- .github/config/labels.yml
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: micnncim/action-label-syncer@v1
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
manifest: .github/config/labels.yml

404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>The page you are requested is not available!!</title>
8-
<link rel="icon" href="favicon.ico" type="image/png"/>
8+
<link rel="icon" href="Writerside/images/favicon.ico" type="image/png"/>
99
<style>
1010
body {
1111
font-family: Arial, sans-serif;

Writerside/topics/Kotlin.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Kotlin
22

33
<!-- TOC -->
4-
54
* [Kotlin](#kotlin)
65
* [Kotlin Compiler Options](#kotlin-compiler-options)
76
* [Native Image](#native-image)
@@ -10,7 +9,6 @@
109
* [Misc](#misc)
1110
* [Math](#math)
1211
* [OpenAPI Doc](#openapi-doc)
13-
1412
<!-- TOC -->
1513

1614
<tldr>

blog/index.html

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>The page you are requested is not available!!</title>
8+
<link rel="icon" href="../Writerside/images/favicon.ico" type="image/png"/>
9+
<style>
10+
body {
11+
font-family: Arial, sans-serif;
12+
background-color: #f0f5f9; /* Light theme background color */
13+
color: #333333; /* Light theme text color */
14+
margin: 0;
15+
padding: 0;
16+
display: flex;
17+
justify-content: center;
18+
align-items: center;
19+
min-height: 100vh;
20+
text-align: center;
21+
}
22+
23+
.container {
24+
background-color: #ffffff; /* Light theme profile background color */
25+
padding: 30px;
26+
border-radius: 8px;
27+
box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
28+
max-width: 600px;
29+
width: 100%;
30+
}
31+
32+
@media (prefers-color-scheme: dark) {
33+
body {
34+
background-color: #1e1e1e; /* Dark theme background color */
35+
color: #f0f0f0; /* Dark theme text color */
36+
}
37+
38+
.container {
39+
background-color: #212121; /* Dark theme profile background color */
40+
}
41+
}
42+
</style>
43+
</head>
44+
45+
<body>
46+
<div class="container">
47+
<h1>Under Construction 🚧</h1>
48+
<p>The blog is not available!</p>
49+
</div>
50+
</body>
51+
52+
</html>

0 commit comments

Comments
 (0)