Skip to content

Commit

Permalink
Streamline CI Workflow and Update Dependencies
Browse files Browse the repository at this point in the history
Revised GitHub Actions workflow for better efficiency:
- Moved the `docs` job to run after the `release` job to ensure documentation is always up-to-date with the latest release.
- Improved doc generation by specifying the project version.
- Added steps to build VitePress site and deploy it to GitHub Pages.

Updated `shard.yml`:
- Removed redundant `shard.version` property.
- Minor syntax tweak to ensure consistency in the `crystal` field.

These changes enhance CI reliability and keep the documentation aligned with releases.
  • Loading branch information
eliasjpr committed Aug 17, 2024
1 parent 30176bf commit b7da311
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
62 changes: 33 additions & 29 deletions .github/workflows/crystal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,34 +61,6 @@ jobs:
env:
DATABASE_URL: postgres://example:example@postgres:5432/example
run: crystal spec

docs:
needs:
- build
if: ${{ success() }}
runs-on: ubuntu-latest
container:
image: crystallang/crystal
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: shards install
- name: Generate Azu API Docs
run: crystal docs
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./docs"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

release:
runs-on: ubuntu-latest
needs:
Expand All @@ -115,7 +87,7 @@ jobs:
uses: fjogeleit/yaml-update-action@master
with:
valueFile: shard.yml
propertyPath: shard.version
propertyPath: version
value: ${{steps.semver.outputs.version}}
branch: master
updateFile: true
Expand All @@ -130,3 +102,35 @@ jobs:
release_name: Release v${{steps.semver.outputs.version}}
draft: false
prerelease: false
docs:
needs:
- release
if: ${{ success() }}
runs-on: ubuntu-latest
container:
image: crystallang/crystal
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: shards install
- name: Generate Azu API Docs
run: crystal docs --project-version=${{ steps.semver.outputs.version }}
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./docs/.vitepress/dist"
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Install dependencies
run: npm ci
- name: Build VitePress site
run: npm run docs:build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 1 addition & 3 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: cql
version: 0.1.0
authors:
- Elias Perez <[email protected]>
crystal: '>= 1.12.2'
crystal: ">= 1.12.2"
license: MIT
dependencies:
ulid:
Expand All @@ -18,5 +18,3 @@ development_dependencies:
github: crystal-lang/crystal-mysql
pg:
github: will/crystal-pg
shard:
version: 0.0.16

0 comments on commit b7da311

Please sign in to comment.