-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add protected automated deployment to environments #1382
base: master
Are you sure you want to change the base?
Conversation
|
chore: Remove kubeconfig dependency (@gytis-ivaskevicius commit) chore: Add workflow for protected auto deployments (extra configuration done in repo > settings > environments)
d889c36
to
47e88e0
Compare
Successful deploy to I am leaving the I would also create new environments for the repository and set protection rules as appropriate; to be discussed with @bernokl. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, has this been tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Only 2 small changes 🙏
.github/workflows/deploy-env.yaml
Outdated
run: | | ||
echo "${{ secrets.ENVRC }}" > .envrc.local | ||
source .envrc.local | ||
nix develop -L --command bash -c " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works by accident, but not the way you think (I think ^^).
It should be a single quote here, because on L52 you close this double quote right before yes
, and reopen it right after. Single quotes, OTOH, will pass everything to the bash running inside the devshell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The purpose of using the double quotes here is to test the CI which initially failed on the single quotes due to setting a single-quoted default value for the environment variable here: ${{ inputs.environment || 'ops-preview-1@us-east-1' }}
. Updated now for final reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P.S: Escaping (\
) the single quotes did not help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, but ${{ inputs.environment || 'ops-preview-1@us-east-1' }}
is evaluated as a very first step, it's GitHub's YAML templating. So these single quotes have nothing to do with Bash, or?
Yes, it works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you :)
- name: 🧰 Setup Nix | ||
uses: cachix/install-nix-action@v21 | ||
|
||
- name: 🚀 Deploy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, but don't we have to build the images first? 🤔 Or at least make sure they're built and pushed to ECR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it, it should not have push
at the top and then it should be fine. We may encounter a race condition once in a while but that's probably not going to be even noticable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I plan to take out push:
once the PR is tested and cleared for merging.
Ref: #1382 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, thanks. I remember I added a check in dapp-store once, to prevent such a race condition, but they use Git commits to tag images.
chore: Remove kubeconfig dependency (@gytis-ivaskevicius commit)
chore: Add workflow for protected auto deployments (extra configuration done in repo > settings > environments)
Context
Reason for the change? If an issue exists, reference it here using a keyword
Proposed Solution
Important Changes Introduced