-
Notifications
You must be signed in to change notification settings - Fork 3
131 lines (115 loc) · 3.65 KB
/
docs.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Update docs
on:
push:
branches:
- main
tags:
- v*
workflow_dispatch:
# workflow_call:
# secrets:
# SSH_GH_PAGES:
# description: 'SSH key for GitHub Pages deployment'
# required: true
# inputs:
# package-dependencies:
# description: 'Apt package dependencies'
# required: false
# default: ''
# type: string
jobs:
wait-for-others:
name: Wait For Other Workflows To Complete
runs-on: ubuntu-latest
steps:
- name: Wait for other workflows
uses: mktcode/consecutive-workflow-action@eb43c6b5852dd0e33efa797a1817196d06daa4b2
with:
token: ${{ secrets.GITHUB_TOKEN }}
publish-dev-docs:
name: Publish dev docs
runs-on: ubuntu-latest
needs: wait-for-others
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Install Python and Dependencies
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt
- name: Render Docs
uses: quarto-dev/quarto-actions/render@v2
with:
to: html
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
folder: docs
target-folder: "${{ github.event.repository.name }}"
ssh-key: ${{ secrets.SSH_GH_PAGES }}
branch: main
git-config-name: ivy-seed
git-config-email: ivydl.team@gmail.com
repository-name: unifyai/docs
clean: true
publish-release-docs:
name: Publish release docs
runs-on: ubuntu-latest
needs: wait-for-others
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Install Python and Dependencies
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt
- name: Render Docs
uses: quarto-dev/quarto-actions/render@v2
with:
to: html
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
folder: docs
target-folder: "${{ github.ref_name != 'dev' && format('{0}/', github.ref_name) || '' }}${{ github.event.repository.name }}"
ssh-key: ${{ secrets.SSH_GH_PAGES }}
branch: main
git-config-name: ivy-seed
git-config-email: ivydl.team@gmail.com
repository-name: unifyai/docs
clean: true
update-versions:
name: Update versions.json
runs-on: ubuntu-latest
needs: publish-release-docs
steps:
- name: Checkout 🛎️ Docs
uses: actions/checkout@v3
with:
repository: unifyai/docs
ssh-key: ${{ secrets.SSH_GH_PAGES }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.10
- name: Add version to ${{ github.event.repository.name }}.json
run: |
python versions/add_version.py ${{ github.event.repository.name }} ${{ github.ref_name }}
- name: Commit and push
run: |
git config --global user.email "ivydl.team@gmail.com"
git config --global user.name "ivy-seed"
git add versions/
git commit -m "Add ${{ github.ref_name }} to ${{ github.event.repository.name }}.json"
git push