2021-01-11 17:33:32 +00:00
|
|
|
name: Docs
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Inject slug/short variables
|
2022-12-21 15:08:16 +00:00
|
|
|
uses: rlespinasse/github-slug-action@v4
|
2021-01-11 17:33:32 +00:00
|
|
|
|
|
|
|
- name: Install Crystal
|
2022-12-21 15:08:16 +00:00
|
|
|
uses: crystal-lang/install-crystal@v1
|
2021-01-11 17:33:32 +00:00
|
|
|
|
|
|
|
- name: Download source
|
2022-12-21 15:08:16 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-01-11 17:33:32 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: shards install
|
|
|
|
|
|
|
|
- name: Build docs
|
|
|
|
run: |
|
|
|
|
sed -i -e 's:<.*>::g' README.md
|
|
|
|
crystal docs --project-version="${{ env.GITHUB_REF_SLUG }}" --source-refname="${{ env.GITHUB_SHA_SHORT }}"
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
2022-12-21 15:08:16 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-11 17:33:32 +00:00
|
|
|
with:
|
|
|
|
name: docs
|
|
|
|
path: docs
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Download artifacts
|
2022-12-21 15:08:16 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2021-01-11 17:33:32 +00:00
|
|
|
with:
|
|
|
|
name: docs
|
|
|
|
path: docs
|
|
|
|
|
|
|
|
- name: Deploy docs 🚀
|
2022-12-21 15:08:16 +00:00
|
|
|
uses: JamesIves/github-pages-deploy-action@4
|
2021-01-11 17:33:32 +00:00
|
|
|
with:
|
2022-12-21 15:08:16 +00:00
|
|
|
branch: gh-pages
|
|
|
|
folder: docs
|
|
|
|
clean: true
|