-
Notifications
You must be signed in to change notification settings - Fork 92
62 lines (54 loc) · 2.69 KB
/
main.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
name: A workflow for mdbook generation
#on: push
#branches: whatever we like
# -book-actions/books/latest
#paths: readme.md
#for example, we can choose the "docker-run-pinot-mdbook.sh" as trigger, which already decides on what modules to pick
on: workflow_dispatch
env:
SCRIPTS_DIR: /home/runner/work/scalable-data-science/scalable-data-science/actions/scripts
GITHUB_TEMPMDBOOKDIR: /home/runner/work/temp #this will be /github/home/_temp/mdbooks once we are out of the runner
GITHUB_MDPUSHDIR: /home/runner/work/_temp/_github_home/temp
GITHUB_DIR_TO_REPO: /home/runner/work/scalable-data-science
LOCAL_SCRIPT_DIR: /root/GIT/scalable-data-science/actions/scripts
DBC_SHARD_DIR: /scalable-data-science
#MODULES: "000_5-sds-2-x-geo 000_4-sds-3-x-ss 000_3-sds-3-x-st"
#MDBOOK_FILES_DIR: /home/runner/work/scalable-data-science/books/mdScaDaMaLeBook
jobs:
build:
name: fetch dbc - generate books
runs-on: ubuntu-latest
steps:
#check out repo so that workflow can access it
- uses: actions/checkout@v2
#- uses: ./actions/action-a
#- uses: ./actions/action-b
- name: get .databrickscfg file
run: |
# create .databrickscfg in runner by echoing it from secrets
touch ${HOME}/.databrickscfg
echo '${{ secrets.DB_KEY }}' > ${HOME}/.databrickscfg
- name: fetch dbc notebooks
run: |
#fetch dbc notebooks using fetch_dbc_notebooks.sh and put them in /home/runner/work/temp
#mkdir $GITHUB_TEMPMDBOOKDIR.
mkdir -p /home/runner/work/temp/dbc
cd $SCRIPTS_DIR
docker run --rm -i --name=python-dbcli --env-file env.list -v /home/runner/work/temp:/root/temp --mount type=bind,source=${HOME}/.databrickscfg,destination=/root/.databrickscfg --mount type=bind,source=$GITHUB_DIR_TO_REPO,destination=/root/GIT lamastex/python-dbcli:latest /bin/bash $LOCAL_SCRIPT_DIR/fetch_dbc.sh
- name: run pinot and rust
run: |
#cd $SCRIPTS_DIR
source $SCRIPTS_DIR/docker-run-pinot-mdbook.sh
source $SCRIPTS_DIR/move-books-actions.sh
- name: Push to another repo
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: '/github/home/temp/.'
destination_repo: ${{ secrets.USERNAME_GITHUB }}/ScaDaMaLe
destination_branch: 'gh-pages'
#destination_folder: 'test-dir' # optional
user_email: ${{ secrets.EMAIL_GITHUB }} # your email
user_name: ${{ secrets.USERNAME_GITHUB }} # your login
commit_message: 'auto-committing'