fix: adjust mfe-deploy workflow environment parameters#7
Conversation
e2eaf14 to
f11bbce
Compare
johanseto
left a comment
There was a problem hiding this comment.
I liked the inputs option...
Anyway I think we could make like a list in readme or comment inline this action explaining how the vars would be configurated by env or general. Also secrets.
Because this was an explicit form to do it but is removed xD
NODE_VERSION:
description: The Node.js version to use
required: true
type: string
ATLAS_OPTIONS:
description: Options for pulling translations (if needed)
required: false
type: string
default: ""
PUBLIC_PATH_CDN:
description: The public CDN path for deployment
required: true
type: string
APP_ID:
description: Application ID used for naming and identification
required: true
type: string
MFE_CONFIG_API_URL:
description: Configuration API URL for the MFE
required: true
type: string
BUCKET_NAME:
description: S3 bucket name (without s3:// prefix)
required: true
type: string- I was thinking and I would ask if you could share how do you call the action...
You need secrets inherit in the caller?
|
@johanseto, I really liked the previous version that included input definitions! It’s unfortunate that in reusable workflows, the caller cannot set the environment before execution. This is how the reusable workflow is being called. Secrets are passed as name: MFE S3 Bucket Deployment 🚀
on:
push:
branches:
- open-release/redwood.nelp
- open-rc/redwood.nelp
pull_request:
branches:
- "**open-rc**"
jobs:
deployment:
uses: nelc/actions-hub/.github/workflows/mfe-s3-bucket-deployment.yml@main
with:
PROD_BRANCH: 'open-release/redwood.nelp'
secrets: inherit |
|
About the variables description, maybe some comments about the github variables and secrets might work. # MFE S3 Bucket Deployment Workflow
# PURPOSE:
# This workflow builds and deploys a Micro Frontend (MFE) application to an AWS S3 bucket
# TRIGGER:
# This is a reusable workflow that can be called from other workflows using workflow_call.
#
# INPUTS:
# - PROD_BRANCH: Name of the production branch (required) - used to determine environment
# REQUIRED GITHUB VARIABLES (vars):
# - NODE_VERSION: Version of Node.js to use for building
# - APP_ID: The ID/name of the MFE application
# - PUBLIC_PATH_CDN: The CDN URL where the MFE will be hosted
# - MFE_CONFIG_API_URL: The API URL for the MFE configuration
# - BUCKET_NAME: The name of the S3 bucket where the MFE will be deployed
# - ATLAS_OPTIONS: Optional. Configuration for translation pulling (if empty, step is skipped)
# REQUIRED SECRETS:
# - AWS_ACCESS_KEY_ID: AWS access key ID with permissions to deploy to S3
# - AWS_SECRET_ACCESS_KEY: AWS secret access key
# - AWS_DEFAULT_REGION: AWS region where the S3 bucket is located
# - AWS_CLOUDFRONT_DISTRIBUTION_ID: CloudFront distribution ID for cache invalidationwhat do you think? |
I like it if possible could you add like a flag for variables that depends on environment. |
|
@johanseto, I just updated the comments as you suggested! |
3a19d42 to
b6cae0b
Compare
b6cae0b to
ebd6d7c
Compare
Problem
In GitHub Actions,
varsandsecretsare evaluated based on the environment specified when calling a job using theenvironment:key. However, according to GitHub's official documentation, reusable workflows do not currently support defining environments at initialization. Reference.Changes
To address this limitation, the reusable workflow must access
varsandsecretsdirectly, as inputs from the caller workflow will not be populated due to the missing environment.Updates:
secretsandvarsdirectly from the job instead of relying on caller inputs.