Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor workflow for static HTML #2

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 26 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
name: Documentation

permissions:
contents: write
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:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- 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:
Expand All @@ -28,16 +33,22 @@ jobs:
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
restore-keys: |
${{ runner.os }}-dub-

- name: Build Documentation
run: dub build -b docs

- name: GitHub Pages
if: success() && github.ref == 'refs/heads/main'
uses: crazy-max/ghaction-github-pages@v4
# Upload site artifact
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
target_branch: gh-pages
build_dir: docs
keep_history: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
Loading