Skip to content

Commit 1d5267b

Browse files
authored
Refactor GitHub Actions deployment to use Antora (#28)
* Refactor GitHub Actions deployment to use Antora Updated workflow to use actions/checkout@v5 and actions/setup-node@v5. Removed Ruby setup and replaced build steps with Antora installation and site generation. Based on the examples from https://docs.antora.org/antora/latest/publish-to-github-pages/#using-github-actions * Update directory path for git push command Change directory to rtos-docs-html before pushing.
1 parent 1e28a7b commit 1d5267b

1 file changed

Lines changed: 13 additions & 24 deletions

File tree

.github/workflows/build-and-publish.yml

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,29 @@ jobs:
1818
if: github.repository == 'eclipse-threadx/rtos-docs-asciidoc'
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
- name: Checkout repository
22+
uses: actions/checkout@v5
2223
with:
2324
persist-credentials: false
2425
path: 'asciidoc'
25-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- name: Checkout external HTML repository
27+
uses: actions/checkout@v5
2628
with:
2729
repository: ${{ env.TARGET_REPO }}
2830
ref: 'main'
29-
path: 'html'
31+
path: 'rtos-docs-html'
3032
token: ${{ secrets.DOCS_PUBLISH_TOKEN }}
31-
- uses: ruby/setup-ruby@d781c1b4ed31764801bfae177617bb0446f5ef8d # v1.218.0
33+
- name: Install Node.js
34+
uses: actions/setup-node@v5
3235
with:
33-
ruby-version: 3.4.1
34-
- uses: reitzig/actions-asciidoctor@c642db5eedd1d729bb8c92034770d0b2f769eda6 # v2.0.2
35-
with:
36-
version: 2.0.23
37-
- name: build html pages
38-
run: |
39-
DESTINATION="${{ github.workspace }}/html"
40-
cd asciidoc/rtos-docs
41-
for directory in `ls -d */`; do
42-
if [ "${directory}" != "media/" ]; then
43-
echo "${directory}"
44-
CURRENT_DESTINATION=${DESTINATION}/${directory}
45-
mkdir -p ${CURRENT_DESTINATION}
46-
(cd "${directory}" && asciidoctor *.adoc --destination-dir=${CURRENT_DESTINATION})
47-
if [ -d "${directory}/media" ]; then
48-
(cd "${directory}" && cp -R media ${CURRENT_DESTINATION})
49-
fi
50-
fi
51-
done
36+
node-version: '18'
37+
- name: Install Antora
38+
run: npm i antora
39+
- name: Generate Site
40+
run: npx antora antora-playbook.yml
5241
- name: push to rtos-docs-html
5342
run: |
54-
cd "${{ github.workspace }}/html"
43+
cd "${{ github.workspace }}/rtos-docs-html"
5544
5645
git config user.name "eclipse-threadx-bot"
5746
git config user.email "<threadx-bot@eclipse.org>"

0 commit comments

Comments
 (0)