From be4f5f6e2beb050d8cec8c5c247b2a8867cad4e9 Mon Sep 17 00:00:00 2001 From: GrantBirki Date: Wed, 16 Oct 2024 23:06:06 -0700 Subject: [PATCH 1/4] init pages ci build for documentation --- .github/workflows/docs.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..dc10f26 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,34 @@ +name: docs + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + docs: + name: docs + runs-on: ubuntu-latest + + 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/install-crystal@v1.8.2 + with: + crystal: ${{ steps.crystal-version.outputs.crystal }} + + - name: bootstrap + run: script/bootstrap --ci + + - name: builds docs + run: crystal docs From 6190c1c7b52418339ecd88ada8c88e281685385f Mon Sep 17 00:00:00 2001 From: GrantBirki Date: Wed, 16 Oct 2024 23:11:46 -0700 Subject: [PATCH 2/4] update workflow --- .github/workflows/docs.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index dc10f26..8798e04 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,13 +6,12 @@ on: - main pull_request: -permissions: - contents: read - jobs: - docs: - name: docs + build: + name: build runs-on: ubuntu-latest + permissions: + contents: read steps: - name: checkout @@ -32,3 +31,26 @@ jobs: - name: builds docs run: crystal docs + + - name: upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3.0.1 + 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/deploy-pages@v4 From 310c89c4eb669a25226b15880fb70d2a11fc91e7 Mon Sep 17 00:00:00 2001 From: GrantBirki Date: Wed, 16 Oct 2024 23:13:33 -0700 Subject: [PATCH 3/4] setup env --- .github/workflows/docs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8798e04..5915f62 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -30,7 +30,9 @@ jobs: run: script/bootstrap --ci - name: builds docs - run: crystal docs + run: | + source script/setup-env + crystal docs - name: upload static files as artifact id: deployment From d59487dbea58f7ff17658e8c6bceaa966f046995 Mon Sep 17 00:00:00 2001 From: GrantBirki Date: Wed, 16 Oct 2024 23:14:59 -0700 Subject: [PATCH 4/4] pin to version --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5915f62..2fb6067 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -55,4 +55,4 @@ jobs: steps: - name: deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v4.0.5