Add CHANGELOG.md (#14) #30
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
name: Publish | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
publish: | |
name: Generate and publish docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Modo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.23.x' | |
- name: Install dependencies | |
run: go get . | |
- name: Install magic CLI | |
run: | | |
curl -ssL https://magic.modular.com | bash | |
source /home/runner/.bash_profile | |
- name: Clone stdlib | |
run: | | |
git clone https://github.com/modularml/mojo.git --depth=1 | |
- name: Install mojo and dependencies | |
run: | | |
source /home/runner/.bash_profile | |
cd mojo | |
magic install --locked | |
- name: Generate JSON docs | |
run: | | |
source /home/runner/.bash_profile | |
cd mojo | |
magic run mojo doc -o ../stdlib.json stdlib/src | |
- name: Create Markdown | |
run: | | |
go run ./cmd/modo markdown -i stdlib.json --mdbook | |
- name: Download mdBook | |
run: | | |
mkdir bin | |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.43/mdbook-v0.4.43-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin | |
- name: Run mdBook | |
run: | | |
bin/mdbook build markdown --dest-dir ../public | |
- name: Archive Markdown artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: markdown | |
path: markdown | |
- name: Archive HTML artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: public | |
path: public | |
- name: Deploy to GitHub Pages | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
uses: crazy-max/ghaction-github-pages@v4 | |
with: | |
target_branch: gh-pages | |
build_dir: public | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |