Skip to content

Commit

Permalink
Pass APP_NAME to build-and-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
daphnegold committed Aug 23, 2023
1 parent 5e64910 commit 71197fb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ name: Build and Publish
on:
workflow_call:
inputs:
app_name:
description: "name of application folder under infra directory"
default: frontend
type: string
ref:
description: The branch, tag or SHA to checkout. When checking out the repository that triggered a workflow, this defaults to the reference or SHA for that event. Otherwise, use branch or tag that triggered the workflow run.
required: true
type: string
workflow_dispatch:
inputs:
app_name:
description: "name of application folder under infra directory"
default: frontend
type: string
ref:
description: The branch, tag or SHA to checkout. When checking out the repository that triggered a workflow, this defaults to the reference or SHA for that event. Otherwise, use branch or tag that triggered the workflow run.
required: true
Expand All @@ -29,13 +37,13 @@ jobs:
ref: ${{ inputs.ref }}

- name: Build release
run: make release-build
run: make APP_NAME=${{ inputs.app_name }} release-build

- name: Configure AWS credentials
uses: ./.github/actions/configure-aws-credentials
with:
app_name: frontend
app_name: ${{ inputs.app_name }}
environment: shared

- name: Publish release
run: make release-publish
run: make APP_NAME=${{ inputs.app_name }} release-publish
1 change: 1 addition & 0 deletions .github/workflows/database-migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
name: Build
uses: ./.github/workflows/build-and-publish.yml
with:
app_name: ${{ inputs.app_name }}
ref: ${{ github.ref }}
run-migrations:
name: Run migrations
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
# - 'infra/**'
workflow_dispatch:
inputs:
app_name:
description: "name of application folder under infra directory"
default: frontend
type: string
environment:
description: "target environment"
required: true
Expand All @@ -25,9 +29,9 @@ on:
- prod

env:
APP_NAME: frontend
# Need to set a default value for when the workflow is triggered from a git push,
# which bypasses the default configuration for inputs
APP_NAME: ${{ inputs.app_name || 'frontend' }}
ENVIRONMENT: ${{ inputs.environment || 'dev' }}

# Need to repeat the expression since env.ENVIRONMENT is not accessible in this context
Expand All @@ -40,6 +44,7 @@ jobs:
name: Database migrations
uses: ./.github/workflows/database-migrations.yml
with:
app_name: ${{ inputs.app_name || 'frontend' }}
environment: ${{ inputs.environment || 'dev' }}
deploy:
name: Deploy
Expand Down

0 comments on commit 71197fb

Please sign in to comment.