Skip to content

Commit

Permalink
ci: simplify Docs GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
trueNAHO committed Sep 9, 2024
1 parent 2a3c17c commit 1072763
Showing 1 changed file with 18 additions and 39 deletions.
57 changes: 18 additions & 39 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,36 @@
---
name: Docs

on:
push:
branches:
- master

jobs:
build:
name: Build

permissions:
contents: read
concurrency:
cancel-in-progress: true
group: pages

jobs:
docs:
runs-on: ubuntu-22.04

steps:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v13
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-conf: |
extra-experimental-features = nix-command flakes
- name: Set up cache
uses: DeterminateSystems/magic-nix-cache-action@v7

- name: Build docs
run: nix -L build github:${{ github.repository }}/${{ github.sha }}#docs

- name: Prepare docs for upload
run: cp -r --dereference --no-preserve=mode,ownership result/ public/

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: public/

deploy:
name: Deploy

needs: build

permissions:
pages: write
contents: read
id-token: write
pages: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-22.04

steps:
- name: Deploy docs to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v13
- uses: DeterminateSystems/magic-nix-cache-action@v7
- run: nix build .#docs

- uses: actions/upload-pages-artifact@v3
with:
path: result

- uses: actions/deploy-pages@v4

0 comments on commit 1072763

Please sign in to comment.