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

Publish user manual on all pushes to main #323

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
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
36 changes: 36 additions & 0 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
# This workflow runs when PRs are merged and tags/builds/publishes a release.

# Run when PRs to main are closed.
on:
push:
branches:
- main
workflow_dispatch:

name: Build and publish a release

jobs:
github-pages:
name: Publish user manual to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
extra-experimental-features = nix-command flakes
accept-flake-config = true

- name: Checkout code
uses: actions/checkout@v3

- name: Build user manual
run: |
RESULT=$(nix build --no-link --print-out-paths --print-build-logs .#ghciwatch.user-manual)
cp -r "$RESULT/share/ghciwatch/html-manual" ghciwatch-user-manual

- name: Publish to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ghciwatch-user-manual/
35 changes: 0 additions & 35 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,38 +206,3 @@ jobs:
[Release ${{ needs.version.outputs.version }}][release] was built and published successfully!

[release]: ${{ steps.create_release.outputs.url }}

github-pages:
name: Publish user manual to GitHub Pages
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download artifacts
# This downloads the uploaded artifacts to the current directory; the
# path format for downloaded artifacts is `{name}/{basename}`, where
# `{basename}` is the basename of the upload `path`.
#
# For example, the following artifact:
#
# - uses: actions/upload-artifact@v3
# with:
# name: linux
# path: target/release/ghciwatch-aarch64-linux
#
# will be downloaded to `linux/ghciwatch-aarch64-linux`.
uses: actions/download-artifact@v3

- name: Extract user manual
run: |
tar --extract \
--verbose \
--file linux/ghciwatch-user-manual.tar.xz

- name: Publish to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ghciwatch-user-manual/
4 changes: 4 additions & 0 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ jobs:
#
# I'd love a better way of implementing this but GitHub doesn't have
# one: https://github.com/github-community/community/discussions/13836
#
# Also, PRs created with the default `secrets.GITHUB_TOKEN` won't
# trigger `pull_request` workflows, so regular CI won't run either.
# See: https://github.com/orgs/community/discussions/65321
token: ${{ secrets.REPO_GITHUB_TOKEN }}
branch: release/${{ steps.new_cargo_metadata.outputs.version }}
delete-branch: true
Expand Down
Loading