Create Specification Document #23
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 Specification | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
# Pull the latest RISC-V Docs container image | |
# https://github.com/riscv/riscv-docs-base-container-image | |
# https://hub.docker.com/r/riscvintl/riscv-docs-base-container-image | |
- name: Pull Container | |
run: | | |
docker pull riscvintl/riscv-docs-base-container-image:latest | |
# Build PDF file using the container | |
- name: Build Files | |
run: | | |
docker run --rm -v ${{ github.workspace }}:/build riscvintl/riscv-docs-base-container-image:latest \ | |
/bin/sh -c 'make' | |
# Set the short SHA and repo name for use in artifact names | |
- name: Set short SHA and repo name | |
run: | | |
echo "SHORT_SHA=$(echo ${GITHUB_SHA::7})" >> $GITHUB_ENV | |
echo "REPO_NAME=$(echo ${GITHUB_REPOSITORY##*/})" >> $GITHUB_ENV | |
# Upload the built PDF file as artifact | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.REPO_NAME }}-${{ env.SHORT_SHA }}.pdf | |
path: ${{ github.workspace }}/*.pdf | |
retention-days: 30 |