-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
V2 Migration #47
V2 Migration #47
Conversation
@webbertakken Is there a way to test deployments in a workflow without actually deploying? The build workflow was a green light but the previous deployment failed. |
Nowadays there is an action that does preview deployments for firebase. It wasn't there when I created this. I have in fact just set that up in another repo of mine and it works well (you would still need to do something based on the env so that the ingeminator code doesn't do stuff in prod though) |
I assume you mean don't let the ingeminator do stuff in the preview deployments and only allow it in prod? Curious if you have any ideas off the top of your head on how to accomplish this. Would you also be able to set up the service credentials as even if we don't use this action in the end, the one we currently use also complains about the login token being deprecated. |
It does all of that stuff for you when you run And you can use https://github.com/webbertakken/brioso as reference if you like. |
Wouldn't I need access to secrets on the versioning-backend repo to add the credential after running init? Or am I supposed to run init in a workflow on GitHub? |
You have editor access in the project edit: removed public email in screenshot I'm not sure what you mean by needing access. Could you be very specific? |
I assume I need to access the secrets tab in the repo settings to be able to add the service account credentials but I can't see the settings tab as an editor, I believe I would need maintainer level access. |
No, you have to run |
I have also given you maintainer access on the repo. |
I'm getting this error:
It sounds like I need even more permissions? https://stackoverflow.com/questions/63995958/firebase-init-functions-returns-403-caller-does-not-have-permission It may also only be possible for an owner to init based on this: https://stackoverflow.com/questions/74860122/firebase-init-hosinggithub-for-organization |
Ok I've made you owner |
The cleanup step claims there is an error deleting the artifact but manually going to the artifact page shows that it did indeed clean up the build artifact so I'm not sure what it's warning about. This should be ready to go now though |
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.
LGTM.
Just make sure we have a backup of the database before the modified cron starts
package.json
Outdated
"devDependencies": { | ||
"firebase-tools": "^13.10.2" |
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.
This should be installed as a global dependency as per the official docs
testDeploy: | ||
name: Test Deploy | ||
needs: [test, build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'yarn' | ||
- name: install dependencies | ||
run: yarn && yarn --cwd ./functions | ||
- name: Deploy test to Firebase | ||
uses: w9jds/firebase-action@v13.10.2 | ||
with: | ||
args: deploy --only functions:testFunction | ||
env: | ||
GCP_SA_KEY: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}' | ||
- name: Cleanup Firebase Test | ||
uses: w9jds/firebase-action@v13.10.2 | ||
with: | ||
args: functions:delete testFunction --force | ||
env: | ||
GCP_SA_KEY: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}' |
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.
Do we still need this?
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 would want to keep it as this is a great way to ensure the project will deploy properly for the actual functions since it requires roughly the same permissions as the main functions and has been setup to require all the secrets that the other functions might use as a deploy test
functions/src/service/discord.ts
Outdated
} | ||
|
||
static async becomeReady(): Promise<void> { | ||
async becomeReady(): Promise<void> { |
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.
This is usually called init
or create
or getInstance
, or made private and called from the constructor.
.github/workflows/main.yml
Outdated
GCP_SA_KEY: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}' | ||
- name: Cleanup Firebase Test | ||
uses: w9jds/firebase-action@v13.10.2 | ||
with: | ||
args: functions:delete testFunction --force | ||
env: | ||
GCP_SA_KEY: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}' |
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.
Better to use --except
flag and deploy in a single transaction, than to later delete a partial deployment.
Changes
This should merge before working on fixing #48. Prior to merging, all existing functions will need to be deleted as updating to v2 cannot be done in place.
Checklist