-
Notifications
You must be signed in to change notification settings - Fork 237
62 lines (58 loc) · 1.7 KB
/
publish-docarray-org.yml
File metadata and controls
62 lines (58 loc) · 1.7 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
name: Manual Publish DocArray[dot]org
on:
workflow_dispatch:
inputs:
release_token:
description: 'Your release token'
required: true
workflow_call:
secrets:
JINA_DEV_BOT:
required: true
# uncomment this line for testing in PR
# push:
jobs:
token-check:
runs-on: ubuntu-latest
steps:
- name: debug
run: |
echo ${{ github.event_name }} event triggered this action
- name: Check release token
id: token-check
run: |
touch SUCCESS
if: inputs.release_token == env.release_token
env:
release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }}
- name: Check trigger event
run: |
touch SUCCESS
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
- name: Fail release token
run: |
[[ -f SUCCESS ]]
copy-readme:
needs: token-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
path: docarray
- uses: actions/checkout@v3
with:
fetch-depth: 1
repository: docarray/docarray.github.io
path: docarray.github.io
token: ${{ secrets.JINA_DEV_BOT }}
- name: Check out DocArray page
run: |
cd ${GITHUB_WORKSPACE}/docarray.github.io
cp ${GITHUB_WORKSPACE}/docarray/README.md .
git config --local user.email "Jina Dev Bot"
git config --local user.name "dev-bot@jina.ai"
if [[ `git status --porcelain` ]]; then
git add README.md && git commit -s -m "chore(docs): sync up README from docarray"
git push
fi