-
Notifications
You must be signed in to change notification settings - Fork 38
82 lines (79 loc) · 2.76 KB
/
documentation.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
name: Build and deploy documentation
permissions:
contents: read
on:
workflow_call:
inputs:
version:
type: string
required: true
description: Version to setup for the doc
docFolder:
type: string
required: false
description: Path for the generated doc folder
default: './generated-doc'
packageName:
type: string
required: false
description: Name of the package for the documentation
default: '@o3r/framework'
artifactName:
type: string
required: false
description: Name of the artifact for the documentation
default: 'documentation'
shouldDeploy:
type: boolean
required: false
description: Should the documentation be deployed
default: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./tools/github-actions/setup
- name: Generate doc
run: yarn doc:generate
- name: Generate package json
working-directory: ${{ inputs.docFolder }}
run: yarn init -y
- name: Update package json
run: yarn update-package ${{ inputs.docFolder }}/package.json --name ${{ inputs.packageName }} --version ${{ inputs.version }}
- run: zip -q -r ${{ inputs.artifactName }}.zip "${{ inputs.docFolder }}" -x "*/node_modules/*" ".cache/*"
shell: bash
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: ${{ inputs.artifactName }}
path: ${{ inputs.artifactName }}.zip
- run: rm -f ${{ inputs.artifactName }}.zip
shell: bash
deploy-on-azure-static-webapp:
if: ${{ inputs.shouldDeploy }}
runs-on: ubuntu-latest
needs: [build]
environment:
name: azure-static-webapp
url: ${{ steps.deploy.outputs.static_web_app_url }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ inputs.artifactName }}
path: '.'
- run: unzip -q -n ${{ inputs.artifactName }}.zip
shell: bash
- run: rm -f ${{ inputs.artifactName }}.zip
shell: bash
- name: deploy
id: deploy
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9 # v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: upload
app_location: ${{ inputs.docFolder }}
skip_app_build: true
skip_api_build: true
config_file_location: '.'