-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
86 lines (69 loc) · 2.34 KB
/
action.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
name: 'Tech Radar Generator'
description: 'Generates a tech radar based on the provided folder. Initially based in the AOE radar'
author: David Vega <dvega@flexion.us>
#TODO: Add parameter for input format for the radar;
# Markdown is implied, under the AOE radar format "<version>/*.md",
# but JSON is also supported
#TODO: Parametrize radar engine; AOE Radar is implied
inputs:
directory:
description: 'Folder containing the tech radar data'
required: true
artifact_name:
description: 'Name of the artifact to upload (optional)'
required: false
publish_to_pages:
description: 'Publish to GitHub Pages (optional)'
required: false
default: "false"
public_url:
description: 'Public URL used for rendering and publishing the radar'
required: false
default: "./build"
radar_name:
description: 'Name of the radar (optional)'
required: false
default: "Flexion Tech Radar"
outputs:
pages_url:
description: 'URL of the GitHub Pages deployment'
value: ${{ steps.deployment.outputs.page_url }}
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
#TODO: Parametrize radar version
#TODO: Extract to script
- name: Install AOE radar
shell: bash
working-directory: ${{ inputs.directory }}
run: |
export PUBLIC_URL=${{ inputs.public_url }}
export REACT_APP_RADAR_NAME="${{ inputs.radar_name }}"
npm ci
npx aoe_technology_radar-buildRadar
npx aoe_technology_radar-generateJson
npx aoe_technology_radar-createStaticFiles
PUBLIC_URL="${{ inputs.public_url }}" npm run build:static
- name: Upload artifact
if: ${{ inputs.publish_to_pages == 'false' }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact_name || 'tech-radar' }}
path: "${{ inputs.directory }}/build"
- name: Setup Pages
if: ${{ inputs.publish_to_pages == 'true' }}
uses: actions/configure-pages@v3
- name: Upload artifact to Pages
uses: actions/upload-pages-artifact@v2
with:
path: ${{ inputs.directory }}/build
#TODO: Add more deployment targets
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2