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

Automatic prod deployments #8

Merged
merged 8 commits into from
Feb 17, 2022
Merged

Automatic prod deployments #8

merged 8 commits into from
Feb 17, 2022

Conversation

r-czajkowski
Copy link
Contributor

Closes: #7

This PR adds a GH workflow that deploys the preview to preview.threshold.network on every pull request that targets to main branch and deploys website to threshold.network on push to main branch.

Add GH workflow that deploys the website app to `threshold.network`. The
workflow will run on the `push` event to the `main` branch and on the
`pull_request` event that targets a `main` branch. This workflow also
posts preview URL to PR.
@netlify
Copy link

netlify bot commented Feb 11, 2022

✔️ Deploy Preview for lucid-roentgen-b5d3b0 ready!

🔨 Explore the source changes: 4329bba

🔍 Inspect the deploy log: https://app.netlify.com/sites/lucid-roentgen-b5d3b0/deploys/62063faf45aff00008d067ae

😎 Browse the preview: https://deploy-preview-8--lucid-roentgen-b5d3b0.netlify.app

@netlify
Copy link

netlify bot commented Feb 11, 2022

✔️ Deploy Preview for agitated-bell-d01e4e ready!

🔨 Explore the source changes: 4329bba

🔍 Inspect the deploy log: https://app.netlify.com/sites/agitated-bell-d01e4e/deploys/62063faf47c6af00072ac342

😎 Browse the preview: https://deploy-preview-8--agitated-bell-d01e4e.netlify.app

We should use `gegithub.head_ref` instead of `github.ref_name`. The
`head_ref` or source branch of the pull request in a workflow run.
To manually trigger a workflow.
nkuba
nkuba previously approved these changes Feb 11, 2022
It should be `/${{ github.head_ref }}`. Please see 0541033.
Copy link
Member

@nkuba nkuba left a comment

Choose a reason for hiding this comment

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

This webpage won't have eth environment versions like mainnet, ropsten. We should use production name instead of mainnet.

.github/workflows/ci.yaml Show resolved Hide resolved
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
@nkuba nkuba dismissed their stale review February 11, 2022 10:40

I changed my mind 😉

This webpage won't have eth environment versions like `mainnet`, `ropsten`.
We should use `production` name instead of `mainnet`.
@nkuba
Copy link
Member

nkuba commented Feb 11, 2022

We just need to configure the secrets and see if it works before we merge.

@pdyraga
Copy link
Member

pdyraga commented Feb 17, 2022

Can we clear the preview.threshold.network bucket once the previewed PR is merged? We do not have to block this PR but I think we should have this functionality both in this repo and in threshold-network/token-dashboard. We do not want to leave dangling, old code under the official domain. It is not helpful for SEO and can lead to security issues in case some scammer points someone to an old dashboard preview link.

Edit: captured in #9

`secrets.PREVIEW_UPLOADER_SERVICE_KEY_JSON_BASE64` ->
`secrets.PROD_PREVIEW_UPLOADER_SERVICE_KEY_JSON_BASE64`

`secrets.PREVIEW_GOOGLE_PROJECT_ID` ->
`secrets.PROD_PREVIEW_GOOGLE_PROJECT_ID`
Comment on lines 57 to 58
service-key: ${{ secrets.PREVIEW_UPLOADER_SERVICE_KEY_JSON_BASE64 }}
project: ${{ secrets.PREVIEW_GOOGLE_PROJECT_ID }}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
service-key: ${{ secrets.PREVIEW_UPLOADER_SERVICE_KEY_JSON_BASE64 }}
project: ${{ secrets.PREVIEW_GOOGLE_PROJECT_ID }}
service-key: ${{ secrets.PROD_PREVIEW_UPLOADER_SERVICE_KEY_JSON_BASE64 }}
project: ${{ secrets.PROD_PREVIEW_GOOGLE_PROJECT_ID }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

.github/workflows/ci.yaml Show resolved Hide resolved
@github-actions
Copy link

We want to have an additional step where the deployment requires manual
approval so we should add environment property.

Co-authored-by: Jakub Nowakowski <[email protected]>
@github-actions
Copy link

1 similar comment
@github-actions
Copy link

Copy link
Member

@nkuba nkuba left a comment

Choose a reason for hiding this comment

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

Looks like it worked 💯

@nkuba nkuba merged commit a89dabf into main Feb 17, 2022
@nkuba nkuba deleted the prod-deployment branch February 17, 2022 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic prod deployments
3 participants