-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (60 loc) · 1.9 KB
/
doc-upload.yml
File metadata and controls
63 lines (60 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright 2024 SECO Mind Srl
#
# SPDX-License-Identifier: CC0-1.0
name: Documentation upload (HTML)
on: [workflow_call]
jobs:
doc-upload-html:
name: "Documentation upload (HTML)"
runs-on: ubuntu-latest
timeout-minutes: 45
concurrency:
group: doc-upload-html-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout Astarte documentation
uses: actions/checkout@v5
with:
repository: astarte-platform/docs
ssh-key: ${{ secrets.SDK_DOC_DEPLOY_KEY }}
path: docs
- name: Download the html doc artifact
uses: actions/download-artifact@v4
with:
name: html-doc
github-token: ${{ secrets.GH_PAT }}
path: ./html
- name: Copy generated docs
run: |
rm -rf docs/device-sdks/common
mkdir -p docs/device-sdks/common
cp -r html/* docs/device-sdks/common
- name: Update index redirect
working-directory: ./docs/device-sdks/
run: |
echo '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=common">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirecting...</title>
<script type="text/javascript">
window.location.href = 'common';
</script>
</head>
<body>
<p>If you are not redirected, <a href="common">click here</a>.</p>
</body>
</html>' > index.html
- name: Commit files
working-directory: ./docs
run: |
git config --local user.email "astarte-machine-sdk@ispirata.com"
git config --local user.name "Astarte Bot"
git add .
git diff-index --quiet HEAD || git commit -m "Update common SDK documentation"
- name: Push changes
working-directory: ./docs
run: |
git push