Repository navigation
80 lines (68 loc) · 2.31 KB
/
Copy path_docs.deploy.yml
File metadata and controls
80 lines (68 loc) · 2.31 KB
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
name: Deploy docs to GitHub Pages
on:
workflow_call:
inputs:
# Available options: dev, prod
configuration:
required: true
type: string
secrets:
SSH_PRIVATE_KEY:
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Checkout repository
- name: Checkout
uses: actions/checkout@v3
# Download cache (documentation)
- name: Download cache (documentation)
uses: actions/cache@v3
with:
path: documentation
key: ${{ runner.os }}-docs-build-${{ github.run_id }}
# Download cache (unit-tests)
- name: Download cache (unit-tests)
uses: actions/cache@v3
with:
path: coverage
key: ${{ runner.os }}-unit-tests-${{ github.run_id }}
# Download cache (audit-report)
- name: Download cache (audit-report)
uses: actions/cache@v3
with:
path: documentation/audit
key: ${{ runner.os }}-audit-build-${{ github.run_id }}
# Download cache (badges)
- name: Download cache (badges)
uses: actions/cache@v3
with:
path: badges
key: ${{ runner.os }}-badges-build-${{ github.run_id }}
# Copy unit tests to documentation directory
- name: Copy unit tests to documentation directory
run: cp -r coverage documentation/coverage
# Copy badges directory to documentation/assets
- name: Copy badges directory to documentation/assets
run: cp -r badges documentation/assets
# Get app version from package.json
- name: Get app version
id: get_version
run: >
echo VERSION=$(CONFIGURATION=${{ inputs.configuration }} node -p -e "process.env.CONFIGURATION == 'dev' ? 'dev' : require('./package.json').version") >> $GITHUB_ENV
# Deploy documentation to Github pages
- name: Deploy documentation 📄
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
branch: gh-pages
folder: documentation
target-folder: ${{ env.VERSION }}
clean: false
# Deploy documentation index to Github pages
- name: Deploy docs-pages
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
branch: gh-pages
folder: docs-pages
clean: false