Skip to content

Commit 34aaf9e

Browse files
authored
Actions deployment (#110)
Here we add the publish pipeline to build the results and publish them using GitHub Pages. This commit also updates the Readme with the new URLs and switches the publish workflow to be triggered from the master branch.
1 parent a9c3f14 commit 34aaf9e

File tree

8 files changed

+150
-23
lines changed

8 files changed

+150
-23
lines changed

.github/workflows/build-pr.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: ghcr.io/dash-industry-forum/dashif-specs:latest
13+
credentials:
14+
username: ${{ github.actor }}
15+
password: ${{ secrets.github_token }}
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Build
20+
env:
21+
# Reset OPTS to empty to make sure we are not using
22+
# interactive mode in CI
23+
OPTS:
24+
run: make -f /tools/Makefile spec SRC=Cpix.bs.md NAME=cpix
25+
26+
- name: Archive
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: dist
30+
path: dist/

.github/workflows/publish.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
contents: read
11+
packages: read
12+
pages: write
13+
id-token: write
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
container:
19+
image: ghcr.io/dash-industry-forum/dashif-specs:latest
20+
credentials:
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.github_token }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Build
27+
env:
28+
# Reset OPTS to empty to make sure we are not using
29+
# interactive mode in CI
30+
OPTS:
31+
run: make -f /tools/Makefile spec SRC=Cpix.bs.md NAME=cpix
32+
33+
- name: Archive
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: dist
37+
path: dist/
38+
39+
package:
40+
runs-on: ubuntu-latest
41+
needs: build
42+
steps:
43+
- uses: actions/download-artifact@v4
44+
with:
45+
name: dist
46+
path: dist
47+
- uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: dist
50+
51+
publish:
52+
runs-on: ubuntu-latest
53+
needs: package
54+
steps:
55+
- name: Deploy to GitHub Pages
56+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# The output directory contains the build output. This is not checked in to source control.
2-
Output
2+
Output
3+
dist/

Readme.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,12 @@ We accept pull requests!
1616

1717
Most recent content from the **master** branch (may contain work in progress):
1818

19-
![Build status of master branch](https://dev.azure.com/dashif/Automation/_apis/build/status/Cpix?branchName=master)
19+
[![Build status of master branch](https://github.com/Dash-Industry-Forum/CPIX/actions/workflows/publish.yml/badge.svg?branch=master)](https://github.com/Dash-Industry-Forum/CPIX/actions/workflows/publish.yml)
2020

21-
* [HTML document](https://dashif-documents.azurewebsites.net/Cpix/master/Cpix.html)
22-
* [PDF document](https://dashif-documents.azurewebsites.net/Cpix/master/Cpix.pdf)
23-
* [Download PDF + HTML as archive](https://dashif-documents.azurewebsites.net/Cpix/master/Cpix.zip)
21+
* [HTML document](http://dashif.org/CPIX/)
22+
* [PDF document](http://dashif.org/CPIX/cpix.pdf)
2423

25-
Most recent content from the **community-review** branch (latest version published for community review):
26-
27-
![Build status of community-review branch](https://dev.azure.com/dashif/Automation/_apis/build/status/Cpix?branchName=community-review)
28-
29-
* [HTML document](https://dashif-documents.azurewebsites.net/Cpix/community-review/Cpix.html)
30-
* [PDF document](https://dashif-documents.azurewebsites.net/Cpix/community-review/Cpix.pdf)
31-
* [Download PDF + HTML as archive](https://dashif-documents.azurewebsites.net/Cpix/community-review/Cpix.zip)
32-
33-
Most recent content from the **published** branch (final outputs published by DASH-IF):
34-
35-
![Build status of published branch](https://dev.azure.com/dashif/Automation/_apis/build/status/Cpix?branchName=published)
36-
37-
* [HTML document](https://dashif-documents.azurewebsites.net/Cpix/published/Cpix.html)
38-
* [PDF document](https://dashif-documents.azurewebsites.net/Cpix/published/Cpix.pdf)
39-
* [Download PDF + HTML as archive](https://dashif-documents.azurewebsites.net/Cpix/published/Cpix.zip)
40-
41-
[View automated build history for all branches](https://dev.azure.com/dashif/Automation/_build?definitionId=6)
4224

4325
# Document authoring
4426

45-
See [Document Authoring Kit](https://dashif.org/DocumentAuthoring/) for details on document authoring process and the relevant tooling.
27+
See [Document Authoring Kit](https://dashif.org/DASH-IF-IOP/authoring/) for details on document authoring process and the relevant tooling.

build.bat

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@echo off
2+
set IMG=dashif/specs-builder:latest
3+
4+
rem Check if OPTS is defined, if not, set default value
5+
if "%OPTS%"=="" (
6+
set OPTS=-ti
7+
)
8+
9+
rem Collect command-line arguments
10+
set TARGETS=%*
11+
12+
rem If no arguments are provided, use "spec"
13+
if "%TARGETS%"=="" (
14+
set TARGETS=spec
15+
)
16+
17+
rem Add parameters to TARGETS
18+
set TARGETS=%TARGETS% SRC=Cpix.bs.md NAME=cpix
19+
20+
echo Running with targets: '%TARGETS%'
21+
docker run --rm %OPTS% -v "%cd%:/data" -p 8000:8000 %IMG% %TARGETS%
22+

build.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Here is the command that can be used to debug or develop with the
4+
# local resources.
5+
#
6+
# docker run --rm -ti -v `pwd`:/data -v `pwd`/build-tools/tools:/tools -v `pwd`/data/boilerplate/dashif:/usr/local/lib/python3.12/dist-packages/bikeshed/spec-data/boilerplate/dashif dashif-specs:latest
7+
#
8+
9+
# Run the docker container and pass all the arguments
10+
IMG=dashif/specs-builder:latest
11+
12+
# Allow to overwrite additional options from the outside.
13+
# We use tty and interactive by default since this makes it easier
14+
# to deal with watch mode and Ctrl-C etc but we can not use this
15+
# for instance in CI mode
16+
if [ -z ${OPTS+x} ]; then
17+
OPTS=-ti
18+
fi
19+
20+
TARGETS="${@}"
21+
if [ -z "${TARGETS}" ]; then
22+
TARGETS="spec"
23+
fi
24+
# Add parameters
25+
TARGETS="${TARGETS} SRC=Cpix.bs.md NAME=cpix"
26+
27+
echo "Run with targets: '${TARGETS}'"
28+
docker run --rm ${OPTS} -v `pwd`:/data -p 8000:8000 \
29+
${IMG} ${TARGETS}

setup.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
docker pull dashif/specs-builder:latest

setup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
# Pull the latest build image
4+
IMG=dashif/specs-builder:latest
5+
docker pull ${IMG}

0 commit comments

Comments
 (0)