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

feat(ci): promote images from staging when deploying to prod #5

Merged
merged 5 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ jobs:
run: |
HAPPY_OIDC_ID_TOKEN=${{env.id_token}} happy config set API_URL ${{ vars.API_URL }} --env prod --aws-profile ""
- name: Deploy to production env
uses: chanzuckerberg/github-actions/.github/actions/deploy-happy-stack@main
uses: chanzuckerberg/github-actions/.github/actions/deploy-happy-stack@v1.26.0
with:
tfe-token: ${{ secrets.TFE_TOKEN }}
env: ${{ vars.HAPPY_ENV }}
create-tag: true

Choose a reason for hiding this comment

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

I see we're dropping create-tag: true entirely with this PR. I don't really know the specifics of deploy-happy-stack, but is this something we'd want to keep with what this PR is adding? It feels like if we wanted a tag created before, we would still want one now, but the new args don't seem to have anything to do with tagging one way or the other. Just wanted to make sure this was purposeful and not an accidentally cut out line!

Copy link
Collaborator Author

@jfoo1984 jfoo1984 Nov 21, 2023

Choose a reason for hiding this comment

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

create-tag defaults to false

https://github.com/chanzuckerberg/github-actions/blob/0b740d81436af68cb9af1011cab89199823c0161/.github/actions/deploy-happy-stack/action.yml#L11-L14

To use the image promotion, create-tag does need to be set to false, since that tells happy to assume that images already exist (for staging -> prod deployment via promotion, they "exist" in the staging env), so I've just dropped it here and relied on the default.

image-source-env: ${{ vars.IMAGE_SOURCE_ENV }}
image-source-stack: ${{ secrets.IMAGE_SOURCE_STACK }}
image-source-role-arn: ${{ secrets.IMAGE_SOURCE_ROLE_ARN }}
stack-name: ${{ secrets.HAPPY_STACK_NAME }}
version-lock-file: .happy/version.lock
2 changes: 1 addition & 1 deletion .github/workflows/deploy-sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: |
HAPPY_OIDC_ID_TOKEN=${{env.id_token}} happy config set API_URL ${{ vars.API_URL }} --env sandbox --aws-profile ""
- name: Update sandbox
uses: chanzuckerberg/github-actions/.github/actions/deploy-happy-stack@main
uses: chanzuckerberg/github-actions/.github/actions/deploy-happy-stack@v1.26.0
with:
tfe-token: ${{ secrets.TFE_TOKEN }}
env: ${{ vars.HAPPY_ENV }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
HAPPY_OIDC_ID_TOKEN=${{env.id_token}} happy config set API_URL ${{ vars.API_URL }} --env staging --aws-profile ""
- name: Deploy to staging env
uses: chanzuckerberg/github-actions/.github/actions/deploy-happy-stack@main
uses: chanzuckerberg/github-actions/.github/actions/deploy-happy-stack@v1.26.0
with:
tfe-token: ${{ secrets.TFE_TOKEN }}
env: ${{ vars.HAPPY_ENV }}
Expand Down
2 changes: 1 addition & 1 deletion .happy/version.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Require": {
"chanzuckerberg/happy": "0.110.1"
"chanzuckerberg/happy": "0.118.2"
}
}
Loading