Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Pages + Documentation #7

Merged
merged 4 commits into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: docs

on:
push:
branches:
- main
pull_request:

jobs:
build:
name: build
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: checkout
uses: actions/checkout@v4

- name: fetch crystal version
id: crystal-version
run: echo "crystal=$(cat .crystal-version)" >> $GITHUB_OUTPUT

- name: install crystal
uses: crystal-lang/[email protected]
with:
crystal: ${{ steps.crystal-version.outputs.crystal }}

- name: bootstrap
run: script/bootstrap --ci

- name: builds docs
run: |
source script/setup-env
crystal docs

- name: upload static files as artifact
id: deployment
uses: actions/[email protected]
with:
path: docs/

deploy:
name: deploy
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write

steps:
- name: deploy to GitHub Pages
id: deployment
uses: actions/[email protected]