-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (82 loc) · 3.24 KB
/
github-travis.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
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Github Travis
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ sources ]
workflow_dispatch: # For manual trigger
repository_dispatch: # For POST request trigger
types: automated-generation
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Prepare git
run: |
git config --global user.name "${{ secrets.BOT_GH_NAME}}"
git config --global user.email "${{ secrets.BOT_GH_EMAIL}}"
- name: Apply netrc creds with direct input again
uses: little-core-labs/netrc-creds@master
with:
machine: github.com
login: ${{ secrets.BOT_GH_NAME}}
password: ${{ secrets.BOT_TOKEN}}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
architecture: x64
- run: pip install -r script/requirements.txt
#
# PRE-COMPILE
#
- name: Get latest wiki
run: git clone --depth 1 https://github.com/gama-platform/gama.wiki.git
- name: Reorganise folders to be more Docusaurus-friendly
shell: bash
run: $GITHUB_WORKSPACE/script/unstructurize.sh
- name: Enforce wiki MDX compliance
shell: sh
run: |
$GITHUB_WORKSPACE/script/link_fixer.sh
# Turn wiki MDX compliante
find ./docs -name "*md" -exec python $GITHUB_WORKSPACE/script/escapingTags.py -i {} -o {} \;
- name: Generate Sidebar
run: |
python $GITHUB_WORKSPACE/script/generateSidebar.py > $GITHUB_WORKSPACE/website/sidebars.json
cat $GITHUB_WORKSPACE/website/sidebars.json
- name: Auto header
shell: sh
run: $GITHUB_WORKSPACE/script/autoHeader.sh
- name: Finish cleaning docs folder
shell: bash
run: $GITHUB_WORKSPACE/script/finalClean.sh
#
# COMPILATION
#
- uses: actions/setup-node@v3
with:
node-version: 'current'
- name: Install dependencies
run: yarn install
working-directory: ./website
- name: Build website
run: yarn build
working-directory: ./website
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: master
publish_dir: ./website/build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com