-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (71 loc) · 2.1 KB
/
update-markdown-files.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Update Markdown Files and Deploy to Pages
on:
push:
branches:
- main
# GitHub Pages 에 배포하기 위한 GITHUB_TOKEN 권한 설정
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
update-markdown:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Swift script and check result
working-directory: ${{ github.workspace }}
run: |
if swift run Scripts; then
echo "Script executed successfully"
else
echo "Script execution failed"
exit 1
fi
deploy:
runs-on: macos-latest
needs: update-markdown
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build Documentation
working-directory: ${{ github.workspace }}
run: |
swift package --allow-writing-to-directory ./docs \
generate-documentation --target AriNote \
--disable-indexing \
--transform-for-static-hosting \
--output-path ./docs
- name: Create index.html for redirection
run: |
echo '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirecting...</title>
<meta http-equiv="refresh" content="0; url=/documentation/arinote/">
<script type="text/javascript">
window.location.href = "/documentation/arinote/";
</script>
</head>
<body>
<p>If you are not redirected automatically, follow this <a href="/documentation/arinote/">Link</a>.</p>
</body>
</html>' > ./docs/index.html
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs