Skip to content

Deploy to GitHub Pages #16

Deploy to GitHub Pages

Deploy to GitHub Pages #16

Workflow file for this run

name: Deploy to GitHub Pages
on:
# Run after the test workflow completes on main branch
workflow_run:
workflows: ["CI"]
branches: [main]
types: [completed]
# Allow manual deployments
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
actions: read
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
# Only run if the test workflow succeeded or this is a manual run
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ".ruby-version"
bundler-cache: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: site/package-lock.json
- name: Install site dependencies
run: cd site && npm ci
- name: Setup Pages
uses: actions/configure-pages@v4
with:
static_site_generator: next
- name: Download coverage artifacts
uses: dawidd6/action-download-artifact@v3 # cspell:ignore dawidd6
with:
workflow: test.yml
workflow_conclusion: success
name: coverage-ruby3.3-rails7.1
path: coverage
- name: Generate YARD documentation
run: |
mkdir -p site/public/yard
# Install development dependencies for YARD
bundle config set --local with 'development'
bundle install
bundle exec yard doc --output-dir=site/public/yard
- name: Copy coverage to site
run: |
# Ensure directory exists
mkdir -p site/public/coverage
# Copy coverage reports
cp -r coverage/* site/public/coverage/
- name: Export TypeScript types
run: |
ruby scripts/export_typescript_types.rb
- name: Build with Next.js
run: cd site && npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site/out
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4