Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE 406] Fix deploy Github Actions workflow #407

Merged
merged 14 commits into from
Aug 25, 2023

Conversation

daphnegold
Copy link
Contributor

@daphnegold daphnegold commented Aug 23, 2023

Summary

Fixes #406

Time to review: 5 mins

Changes proposed

  • Add more restrictions for APP_NAME in makefile
  • Pass APP_NAME to all relevant make commands
  • Create cd-frontend.yml that calls deploy.yml

Test workflow dispatch: https://github.com/HHS/grants-equity/actions/runs/5957648324

On PR

Screenshot 2023-08-23 at 4 55 01 PM

Dispatch workflow

cmd: gh workflow run cd-frontend.yml --ref daphnegold/issue-406-build-publish-fix --app-name frontend

Screenshot 2023-08-23 at 4 55 09 PM

Vuln scans

https://github.com/HHS/grants-equity/actions/runs/5967002978?pr=407
Screenshot 2023-08-24 at 10 35 17 AM

end-to-end infra tests

https://github.com/HHS/grants-equity/actions/runs/5968825293/job/16193471947?pr=407

@daphnegold daphnegold added the topic: infra Infrastructure related tickets label Aug 23, 2023
.github/workflows/build-and-publish.yml Outdated Show resolved Hide resolved
Comment on lines -8 to -15
# !! Uncomment the following lines once you've set up the dev environment and ready to turn on continuous deployment
# push:
# branches:
# - 'main'
# paths:
# - 'frontend/**'
# - 'bin/**'
# - 'infra/**'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to leave this commented out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that? We have a dev environment set up

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry i totally thought i was reviewing a Pr in a different repo

.github/workflows/deploy.yml Outdated Show resolved Hide resolved
.github/workflows/deploy.yml Outdated Show resolved Hide resolved
@daphnegold daphnegold requested a review from lorenyu August 23, 2023 23:36
@daphnegold daphnegold force-pushed the daphnegold/issue-406-build-publish-fix branch from 92f73ec to d285140 Compare August 24, 2023 00:48
Copy link
Contributor

@SammySteiner SammySteiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

nit: I noticed you chose to make the inputs type string, however I think unless they put in frontend or api it will break. In that case, should we make them type of choice with frontend and api so that it can't be broken by putting in a typo?

.github/workflows/deploy.yml Show resolved Hide resolved
app_name:
description: "name of application folder under infra directory"
required: true
type: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this fail if something other than frontend or api is entered? In that case should we make this type a choice instead of string to reduce the chance of mistakes?

Copy link
Contributor Author

@daphnegold daphnegold Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't run if you don't manage to type the app name correctly. We have another ticket to work on monorepo structure of Github Actions after integrating backend. See #285. The infrastructure for the api doesn't exist yet, so adding api as a choice to deploy would fail for that reason.

.github/workflows/build-and-publish.yml Show resolved Hide resolved
.github/workflows/database-migrations.yml Show resolved Hide resolved
@daphnegold daphnegold force-pushed the daphnegold/issue-406-build-publish-fix branch from 9a8fe3a to 31917b6 Compare August 24, 2023 17:31
@daphnegold daphnegold force-pushed the daphnegold/issue-406-build-publish-fix branch 5 times, most recently from f0b6adf to e17a3ff Compare August 24, 2023 20:57
@daphnegold daphnegold force-pushed the daphnegold/issue-406-build-publish-fix branch from e17a3ff to 9fbfd1a Compare August 24, 2023 22:45
Copy link

@lorenyu lorenyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, defer to your team on this, no objections from me.

i probably won't be paramterizing/adding a flag to infra_test in the template repo but i don't have an issue with you doing it here

@SammySteiner
Copy link
Contributor

updates look good!

@daphnegold daphnegold merged commit 32343e6 into main Aug 25, 2023
@daphnegold daphnegold deleted the daphnegold/issue-406-build-publish-fix branch August 25, 2023 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infra Infrastructure related tickets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Fix deploy Github Actions workflow
3 participants