Skip to content

Merge pull request #2 from chances/docs-github-pages #7

Merge pull request #2 from chances/docs-github-pages

Merge pull request #2 from chances/docs-github-pages #7

Workflow file for this run

name: Documentation
permissions:
contents: read
pages: write
id-token: write
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
# Build docs with Ddoc
- name: Install D compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-latest
- name: Cache DUB Artifacts
uses: actions/cache@v2
with:
path: ~/.dub
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
restore-keys: |
${{ runner.os }}-dub-
- name: Build Documentation
run: dub build -b docs
# Upload site artifact
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4