Skip to content

Commit

Permalink
Adding action as-is, plus some aspirational TODO notes
Browse files Browse the repository at this point in the history
  • Loading branch information
dvega-flexion committed Jan 31, 2024
1 parent 82973d7 commit acfe8d8
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions action.yml
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

0 comments on commit acfe8d8

Please sign in to comment.