Skip to content

Deploy

Deploy #6

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
env:
REPOSITORY: toitware/web-docs
ARTIFACT_EXTENSION: tgz
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: Untar
run: |
cd build
VERSION=$(cat VERSION)
tar x -zf $VERSION.$ARTIFACT_EXTENSION
rm $VERSION.$ARTIFACT_EXTENSION
- name: Disable Jekyll
run: |
touch build/.nojekyll
# 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: docs-dev.toit.io