generated from riscv/docs-spec-template
-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (41 loc) · 1.32 KB
/
build-pdf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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