-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding action as-is, plus some aspirational TODO notes
- Loading branch information
1 parent
82973d7
commit acfe8d8
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: 'Tech Radar' | ||
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=/cloud-cost-opt-toolkit 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 |