Skip to content

Commit 01d155a

Browse files
Update documentation actions (SkriptLang#8380)
1 parent 94d9924 commit 01d155a

6 files changed

Lines changed: 89 additions & 111 deletions

File tree

.editorconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ root = true
66
end_of_line = lf
77
indent_style = tab
88
indent_size = 4
9-
charset = utf-8
9+
charset = utf-8
10+
11+
[*.{yaml,yml}]
12+
indent_style = space
13+
indent_size = 2

.github/workflows/docs/generate-docs/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ inputs:
66
required: true
77
type: string
88
docs_repo_dir:
9-
description: "The skript-docs repository directory"
9+
description: "The documentation repository directory"
1010
required: true
1111
type: string
1212
skript_repo_dir:
13-
description: "The skript repository directory"
13+
description: "The Skript repository directory"
1414
required: true
1515
type: string
1616
is_release:
@@ -24,14 +24,14 @@ inputs:
2424
default: "*"
2525
type: string
2626
generate_javadocs:
27-
description: "Designates whether to generate javadocs for this nightly documentation"
27+
description: "Designates whether to generate Javadocs for this documentation"
2828
required: false
2929
default: false
3030
type: boolean
3131

3232
outputs:
3333
DOCS_CHANGED:
34-
description: "Whether or not the documentation has changed since the last push"
34+
description: "Whether the documentation has changed since the last push"
3535
value: ${{ steps.generate.outputs.DOCS_CHANGED }}
3636

3737
runs:

.github/workflows/docs/push-docs/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Push documentation
22

33
inputs:
44
docs_repo_dir:
5-
description: "The skript-docs repository directory"
5+
description: "The documentation repository directory"
66
required: true
77
type: string
88
git_email:
Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,28 @@
11
name: Setup documentation environment
22

33
inputs:
4-
docs_deploy_key:
5-
description: "Deploy key for the skript-docs repo"
4+
docs_repo:
5+
description: "Documentation repository to use"
66
required: true
77
type: string
8-
docs_output_dir:
9-
description: "The directory to generate the documentation into"
8+
docs_token:
9+
description: "Access token for the documentation repository"
1010
required: true
1111
type: string
12-
cleanup_pattern:
13-
description: "A pattern designating which files to delete when cleaning the documentation output directory"
14-
required: false
15-
default: "*"
16-
type: string
1712

1813
runs:
1914
using: 'composite'
2015
steps:
21-
- name: Checkout skript-docs
16+
- name: Checkout documentation repository
2217
uses: actions/checkout@v3
2318
with:
24-
repository: 'SkriptLang/skript-docs'
19+
repository: ${{ inputs.docs_repo }}
2520
path: skript-docs
26-
ssh-key: ${{ inputs.docs_deploy_key }}
21+
token: ${{ inputs.docs_token }}
2722
- uses: actions/setup-java@v3
2823
with:
2924
java-version: '21'
3025
distribution: 'adopt'
3126
cache: gradle
3227
- shell: bash
3328
run: chmod +x ./skript/gradlew
34-
- shell: bash
35-
env:
36-
DOCS_DEPLOY_KEY: ${{ inputs.docs_deploy_key }}
37-
DOCS_OUTPUT_DIR: ${{ inputs.docs_output_dir }}
38-
CLEANUP_PATTERN: ${{ inputs.cleanup_pattern }}
39-
run: |
40-
eval `ssh-agent`
41-
echo "$DOCS_DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
42-
mkdir ~/.ssh
43-
ssh-keyscan www.github.com >> ~/.ssh/known_hosts

.github/workflows/nightly-docs.yml

Lines changed: 37 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,45 @@ on:
55
branches:
66
- 'dev/feature'
77
- 'dev/patch'
8-
- 'enhancement/**'
98
- 'feature/**'
10-
- 'fix/**'
119
tags-ignore:
1210
- '**'
1311

1412
jobs:
15-
nightly-docs:
16-
if: "!contains(toJSON(github.event.commits.*.message), '[ci skip]')"
17-
runs-on: ubuntu-latest
18-
steps:
19-
- name: Configure workflow
20-
id: configuration
21-
env:
22-
DOCS_DEPLOY_KEY: ${{ secrets.DOCS_DEPLOY_KEY }}
23-
run: |
24-
if [ -n "$DOCS_DEPLOY_KEY" ]
25-
then
26-
echo "DOCS_DEPLOY_KEY_PRESENT=true" >> $GITHUB_OUTPUT
27-
else
28-
echo "Secret 'DOCS_DEPLOY_KEY' not present. Exiting job."
29-
fi
30-
BRANCH_NAME="${GITHUB_REF#refs/*/}"
31-
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT
32-
echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/nightly/${BRANCH_NAME}" >> $GITHUB_OUTPUT
33-
echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT
34-
echo "SKRIPT_REPO_DIR=${GITHUB_WORKSPACE}/skript" >> $GITHUB_OUTPUT
35-
- name: Checkout Skript
36-
uses: actions/checkout@v6
37-
with:
38-
submodules: recursive
39-
path: skript
40-
- name: Setup documentation environment
41-
if: steps.configuration.outputs.DOCS_DEPLOY_KEY_PRESENT == 'true'
42-
uses: ./skript/.github/workflows/docs/setup-docs
43-
with:
44-
docs_deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
45-
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
46-
- name: Generate documentation
47-
id: generate
48-
if: steps.configuration.outputs.DOCS_DEPLOY_KEY_PRESENT == 'true'
49-
uses: ./skript/.github/workflows/docs/generate-docs
50-
with:
51-
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
52-
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
53-
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
54-
- name: Push nightly documentation
55-
if: steps.generate.outputs.DOCS_CHANGED == 'true'
56-
uses: ./skript/.github/workflows/docs/push-docs
57-
with:
58-
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
59-
git_name: Nightly Docs Bot
60-
git_email: nightlydocs@skriptlang.org
61-
git_commit_message: "Update ${{ steps.configuration.outputs.BRANCH_NAME }} branch nightly docs to ${{ github.repository }}@${{ github.sha }}"
13+
nightly-docs:
14+
if: "!contains(toJSON(github.event.commits.*.message), '[ci skip]')"
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Configure workflow
18+
id: configuration
19+
run: |
20+
BRANCH_NAME="${GITHUB_REF#refs/*/}"
21+
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT
22+
echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/nightly/${BRANCH_NAME}" >> $GITHUB_OUTPUT
23+
echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT
24+
echo "SKRIPT_REPO_DIR=${GITHUB_WORKSPACE}/skript" >> $GITHUB_OUTPUT
25+
- name: Checkout Skript
26+
uses: actions/checkout@v6
27+
with:
28+
submodules: recursive
29+
path: skript
30+
- name: Setup documentation environment
31+
uses: ./skript/.github/workflows/docs/setup-docs
32+
with:
33+
docs_repo: "SkriptLang/skript-docs"
34+
docs_token: ${{ secrets.DOCS_TOKEN }}
35+
- name: Generate documentation
36+
id: generate
37+
uses: ./skript/.github/workflows/docs/generate-docs
38+
with:
39+
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
40+
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
41+
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
42+
- name: Push nightly documentation
43+
if: steps.generate.outputs.DOCS_CHANGED == 'true'
44+
uses: ./skript/.github/workflows/docs/push-docs
45+
with:
46+
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
47+
git_name: Nightly Docs Bot
48+
git_email: nightlydocs@skriptlang.org
49+
git_commit_message: "Update ${{ steps.configuration.outputs.BRANCH_NAME }} branch nightly docs to ${{ github.repository }}@${{ github.sha }}"

.github/workflows/release-docs.yml

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,45 @@ name: Release documentation
22

33
on:
44
release:
5-
types: [published]
5+
types: [ published ]
66
workflow_dispatch:
77

88
jobs:
99
release-docs:
1010
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Configure workflow
14-
id: configuration
15-
run: |
16-
echo "BRANCH_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
17-
echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/" >> $GITHUB_OUTPUT
18-
echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT
19-
echo "SKRIPT_REPO_DIR=${GITHUB_WORKSPACE}/skript" >> $GITHUB_OUTPUT
20-
- name: Checkout Skript
21-
uses: actions/checkout@v6
22-
with:
23-
submodules: recursive
24-
path: skript
25-
- name: Setup documentation environment
26-
uses: ./skript/.github/workflows/docs/setup-docs
27-
with:
28-
docs_deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
29-
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
30-
- name: Generate documentation
31-
uses: ./skript/.github/workflows/docs/generate-docs
32-
with:
33-
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
34-
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
35-
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
36-
is_release: true
37-
generate_javadocs: true
38-
cleanup_pattern: "!(nightly|archives|templates)"
39-
- name: Push release documentation
40-
uses: ./skript/.github/workflows/docs/push-docs
41-
with:
42-
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
43-
git_name: Release Docs Bot
44-
git_email: releasedocs@skriptlang.org
45-
git_commit_message: "Update release docs to ${{ steps.configuration.outputs.BRANCH_NAME }}"
13+
- name: Configure workflow
14+
id: configuration
15+
run: |
16+
BRANCH_NAME="${GITHUB_REF#refs/*/}"
17+
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT
18+
echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/" >> $GITHUB_OUTPUT
19+
echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT
20+
echo "SKRIPT_REPO_DIR=${GITHUB_WORKSPACE}/skript" >> $GITHUB_OUTPUT
21+
- name: Checkout Skript
22+
uses: actions/checkout@v6
23+
with:
24+
submodules: recursive
25+
path: skript
26+
- name: Setup documentation environment
27+
uses: ./skript/.github/workflows/docs/setup-docs
28+
with:
29+
docs_repo: "SkriptLang/skript-docs"
30+
docs_token: ${{ secrets.DOCS_TOKEN }}
31+
- name: Generate documentation
32+
uses: ./skript/.github/workflows/docs/generate-docs
33+
with:
34+
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
35+
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
36+
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
37+
is_release: true
38+
generate_javadocs: true
39+
cleanup_pattern: "!(nightly|archives|templates)"
40+
- name: Push release documentation
41+
uses: ./skript/.github/workflows/docs/push-docs
42+
with:
43+
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
44+
git_name: Release Docs Bot
45+
git_email: releasedocs@skriptlang.org
46+
git_commit_message: "Update release docs to ${{ steps.configuration.outputs.BRANCH_NAME }}"

0 commit comments

Comments
 (0)