This repository has been archived by the owner on May 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
110 lines (98 loc) · 3.64 KB
/
docs.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Docs
on:
push:
branches:
- main
paths:
- "docs/**"
- ".github/workflows/docs.yml"
pull_request:
workflow_dispatch:
jobs:
docs-detect-changes:
runs-on: ubuntu-latest
outputs:
path-filter: ${{ steps.filter.outputs.path-filter }}
steps:
- uses: actions/checkout@v2
if: github.event_name == 'pull_request'
- uses: dorny/paths-filter@v2
if: github.event_name == 'pull_request'
id: filter
with:
filters: |
path-filter:
- './docs/**'
- './.github/workflows/docs.yml'
# TODO: Add generation of Solidity documentation
docs-generate-and-publish-html:
runs-on: ubuntu-latest
needs: [docs-detect-changes]
if: |
github.event_name != 'pull_request'
|| needs.docs-detect-changes.outputs.path-filter == 'true'
steps:
- uses: actions/checkout@v2
- name: Build HTML docs
id: html
uses: thesis/asciidoctor-action@v1.1
with:
files: "docs/*.adoc docs/**/*.adoc"
args: "-a revdate=`date +%Y-%m-%d` --failure-level=ERROR"
- name: Copy images to output directory
run: sudo cp -r docs/img/ ${{ steps.html.outputs.asciidoctor-artifacts }}/docs/
# A push event is a main merge; deploy to primary bucket.
- if: github.event_name == 'push'
name: Upload asciidocs
uses: thesis/gcp-storage-bucket-action@v3.1.0
with:
service-key: ${{ secrets.DOCS_KEEP_NETWORK_UPLOADER_SERVICE_KEY_JSON }}
project: cfc-production
bucket-name: docs.keep.network
bucket-path: ecdsa
build-folder: ${{ steps.html.outputs.asciidoctor-artifacts }}/docs
# A pull_request event is a PR; deploy to preview bucket.
- if: github.event_name == 'pull_request'
name: Upload asciidocs preview
uses: thesis/gcp-storage-bucket-action@v3.1.0
with:
service-key: ${{ secrets.DOCS_KEEP_NETWORK_UPLOADER_SERVICE_KEY_JSON }}
project: cfc-production
bucket-name: docs.keep.network
bucket-path: ecdsa/${{ github.head_ref }}
build-folder: ${{ steps.html.outputs.asciidoctor-artifacts }}/docs
docs-generate-and-publish-pdf:
runs-on: ubuntu-latest
needs: [docs-detect-changes]
if: |
github.event_name != 'pull_request'
|| needs.docs-detect-changes.outputs.path-filter == 'true'
steps:
- uses: actions/checkout@v2
- name: Build PDF docs
id: pdf
uses: thesis/asciidoctor-action@v1.1
with:
files: "docs/*.adoc docs/**/*.adoc"
format: pdf
args: "-a revdate=`date +%Y-%m-%d` --failure-level=ERROR"
# A push event is a main merge; deploy to primary bucket.
- if: github.event_name == 'push'
name: Upload asciidocs
uses: thesis/gcp-storage-bucket-action@v3.1.0
with:
service-key: ${{ secrets.DOCS_KEEP_NETWORK_UPLOADER_SERVICE_KEY_JSON }}
project: cfc-production
bucket-name: docs.keep.network
bucket-path: ecdsa
build-folder: ${{ steps.pdf.outputs.asciidoctor-artifacts }}/docs
# A pull_request event is a PR; deploy to preview bucket.
- if: github.event_name == 'pull_request'
name: Upload asciidocs preview
uses: thesis/gcp-storage-bucket-action@v3.1.0
with:
service-key: ${{ secrets.DOCS_KEEP_NETWORK_UPLOADER_SERVICE_KEY_JSON }}
project: cfc-production
bucket-name: docs.keep.network
bucket-path: ecdsa/${{ github.head_ref }}
build-folder: ${{ steps.pdf.outputs.asciidoctor-artifacts }}/docs