Build Site #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Site | |
on: | |
push: | |
paths-ignore: | |
- 'docs/index.html' | |
- 'LICENSE' | |
- 'README.md' | |
- '.gitignore' | |
- '.github/**' | |
- '.git/**' | |
branches: ["master"] | |
workflow_dispatch: | |
workflow_run: | |
workflows: | |
- "Append Link from Approved Link Request" | |
- "Update AF Links from Approved Issue" | |
types: | |
- completed | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
env: | |
DOCS_DIR: docs | |
jobs: | |
# Build site with pug | |
pug: | |
name: Pug Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build page with pug | |
env: | |
NODE_ENV: production | |
DOCS_DIR: ${{ github.workspace }}/${{ env.DOCS_DIR }} | |
run: npm run build | |
- name: Upload docs artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: ${{ github.workspace }}/${{ env.DOCS_DIR }} | |
# Build site with jekyll | |
jekyll: | |
name: Jekyll Build | |
runs-on: ubuntu-latest | |
needs: pug | |
steps: | |
- name: Download docs artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
path: ./${{ env.DOCS_DIR }} | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./${{ env.DOCS_DIR }} | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
# Deploy site to GH Pages | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: jekyll | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |