Merge pull request #7 from GrantBirki/pages #5
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: 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] |