-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.43 KB
/
update-api-docs.yml
File metadata and controls
52 lines (43 loc) · 1.43 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
name: Update API Documentation
on:
push:
tags:
- 'v*.*.*'
jobs:
update-docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get tag name
id: get_tag
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Update API specification version
run: |
# 태그에서 v 접두사 제거
VERSION=$(echo ${{ env.TAG_NAME }} | sed 's/^v//')
# 버전 정보 업데이트
sed -i "s/- \*\*버전\*\*: .*/- \*\*버전\*\*: $VERSION/" fastapi/src/docs/api_specification.md
- name: Get API specification content
id: get_content
run: |
CONTENT=$(cat fastapi/src/docs/api_specification.md)
echo "API_CONTENT<<EOF" >> $GITHUB_ENV
echo "$CONTENT" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ env.TAG_NAME }}
draft: false
prerelease: false
files: fastapi/src/docs/api_specification.md
body: |
# ChatBot-AI API ${{ env.TAG_NAME }}
API 문서가 업데이트되었습니다.
${{ env.API_CONTENT }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}