Skip to content

Commit

Permalink
Merge pull request #7 from GrantBirki/pages
Browse files Browse the repository at this point in the history
GitHub Pages + Documentation
  • Loading branch information
GrantBirki authored Oct 17, 2024
2 parents 55a2a0c + d59487d commit 668a366
Showing 1 changed file with 58 additions and 0 deletions.
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]

0 comments on commit 668a366

Please sign in to comment.