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

Deploy GitHub pages on every commit to main #89

Merged
merged 1 commit into from
Feb 6, 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
18 changes: 9 additions & 9 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ on:
required: false
type: boolean
default: false
pages:
description: Deploy HTML to Github pages?
required: false
type: boolean
default: false
pull_request:
push:
branches:
Expand All @@ -54,12 +49,17 @@ jobs:
run: docker pull riscvintl/riscv-docs-base-container-image:latest

# Override VERSION and REVMARK for manual workflow dispatch
- name: Update environment variables
- name: Update environment variables for releases
run: |
echo "VERSION=v${{ github.event.inputs.version }}" >> "$GITHUB_ENV"
echo "REVMARK=${{ github.event.inputs.revision_mark }}" >> "$GITHUB_ENV"
if: github.event_name == 'workflow_dispatch'

- name: Update environment variables for push events
run: |
echo "EXTRA_ASCIIDOC_OPTIONS=-a github_commit_sha=$GITHUB_SHA" >> "$GITHUB_ENV"
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

# Build PDF and HTML.
- name: Build Files
run: make all
Expand All @@ -77,13 +77,13 @@ jobs:
# Upload GitHub pages artefacts.
- name: Make gitlab pages directory
run: mkdir dist && cp build/*.html dist/index.html
if: github.event_name == 'workflow_dispatch'
if: github.event_name == 'push'

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
if: github.event_name == 'workflow_dispatch'
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'

# Create Release
- name: Create Release
Expand All @@ -103,7 +103,7 @@ jobs:

# Deploy HTML to Github pages.
deploy:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

needs: build

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ GEN_SRC = $(GEN_DIR)/both_mode_insns_table_body.adoc \

# AsciiDoctor command
ASCIIDOC = asciidoctor-pdf
EXTRA_ASCIIDOC_OPTIONS ?=

ASCIIDOC_OPTIONS = --trace \
-a compress \
Expand All @@ -96,7 +97,7 @@ ASCIIDOC_OPTIONS = --trace \
-a cheri_v9_annotations='' \
-a pdf-fontsdir=docs-resources/fonts \
-a pdf-theme=docs-resources/themes/riscv-pdf.yml \
--failure-level=ERROR
--failure-level=ERROR $(EXTRA_ASCIIDOC_OPTIONS)
ASCIIDOC_REQUIRES = --require=asciidoctor-bibtex \
--require=asciidoctor-diagram \
--require=asciidoctor-mathematical
Expand Down
6 changes: 6 additions & 0 deletions src/riscv-cheri.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ endif::[]
// Preface
///////////////////////////////////////////////////////////////////////////////

ifdef::github_commit_sha[]
[IMPORTANT]
This document is a specification snapshot built from https://github.com/riscv/riscv-cheri/commit/{github_commit_sha} and is not a versioned release.
The latest versioned PDF release can be downloaded from https://github.com/riscv/riscv-cheri/releases.
endif::[]

[WARNING]
.This document is in the link:http://riscv.org/spec-state[Development state]
====
Expand Down
Loading