Github Travis #943
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |