Skip to content

Deploy

Deploy #8

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
inputs:
run-id:
description: The run-id of the workflow to fetch the artifacts from
required: true
type: number
toit-version:
description: 'The version of the Toit documentation to fetch'
required: true
type: string
env:
REPOSITORY: toitware/web-toitdocs
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# No need to checkout the project, since all we need is to download the
# build artifact from the build step.
- uses: actions/download-artifact@v4
with:
repository: ${{ env.REPOSITORY }}
github-token: ${{ secrets.LEON_REPOSITORY_DISPATCH }}
run-id: ${{ github.event.inputs.run-id }}
name: build
path: build
- name: Disable Jekyll
run: |
touch build/.nojekyll
- name: Untar
run: |
cd build
tar x -zf *.tar.gz
rm *.tar.gz
- name: Fetch Toit documentation
run: |
# Fetch the Toit documentation from the GitHub release page.
VERSION=${{ github.event.inputs.toit-version }}
if [[ -z "$VERSION" || "$VERSION" == "latest" ]]; then
URL=https://github.com/toitlang/toit/releases/latest/download/toitdoc.json
else
URL=https://github.com/toitlang/toit/releases/download/$VERSION/toitdoc.json
fi
echo "Fetching Toit documentation from $URL"
mkdir -p build/sdk
curl -L $URL -o build/sdk/latest.json
# This seems to be the simplest way to publish to a separate branch.
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./build
# Optional. This will create a CNAME file so GitHub Pages serves it
# under this domain.
cname: libs-dev.toit.io