forked from usnistgov/800-63-4
-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (46 loc) · 1.9 KB
/
build-release-latest-pdfs.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
47
48
49
50
51
52
53
54
55
56
# Builds and releases
name: build-release-latest-pdfs
on:
# Triggers the workflow on a push to the "REV-4" branch
push:
branches: [ "REV-4" ]
# Allow manually-started runs
workflow_dispatch:
jobs:
build-release-pdfs:
# Use github-hosted runner
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out Repo
uses: actions/checkout@v3
# Set date, commit hash for CI builds
- name: Set date and commit hash for CI builds
id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "::set-output name=build_date::$(date '+%Y-%m-%d')"
- name: Debug- Check outputs
run: |
echo ${{ steps.vars.outputs.sha_short }}
echo ${{ steps.vars.outputs.build_date }}
# Add the date/commit hash/cover label to documents
- name: Modify document frontmatter
run: |
sed -E -i "/page_doc_number:/s/($| *\(.*\) *)/ (${{ steps.vars.outputs.sha_short }})/" _pdf.yml
sed -E -i "s/draft_stage:.*/draft_stage: CI Build (${{ steps.vars.outputs.sha_short }})/" _pdf.yml
sed -E -i "s/issued_date:.*/issued_date: ${{ steps.vars.outputs.build_date }}/" _pdf.yml
# Build PDFs with docker
- name: Build the artifacts with the docker image
run: docker-compose -f docker-compose-pdf.yml up
# Create/update documents under Latest tag
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
title: "Development Build"
files: |
_pdf/SP-800-63-4/SP-800-63-4.pdf
_pdf/SP-800-63A-4/SP-800-63A-4.pdf
_pdf/SP-800-63B-4/SP-800-63B-4.pdf
_pdf/SP-800-63C-4/SP-800-63C-4.pdf