ubiquity / ts-template

A template repository for all @ubiquity projects.
2 stars 24 forks source link

Create a reusable web deploy workflow #6

Closed rndquu closed 1 year ago

rndquu commented 1 year ago

Right now for each repository which requires a web deploy we use separate github workflows (example 1 and example 2)

Github has a feature of reusing workflows across all repositories in a single organisation

What should be done:

  1. Create a reusable web deploy workflow (which will deploy to cloudflare pages in our case)
  2. Remove old deployment workflows and apply the new reusable workflow to these repos:
  3. Add feature of supporting custom domains like 2aa376b3.pay-ubq-fi.ubiquitydao.dev

So in the end we should get a reusable workflow which:


Improvement of https://github.com/ubiquity/ts-template/issues/1

0x4007 commented 1 year ago

It isn't clear to me how this will solve the original proposed problem. Sure we can have the core logic in a shared workflow file but each repository still must call the shared workflow with a new workflow file. Mind as well just fork the core logic and add to every repository anyways.

My proposal was to have our bot automatically have it on for every repo without any custom setup/configuration required.

rndquu commented 1 year ago

It isn't clear to me how this will solve the original proposed problem. Sure we can have the core logic in a shared workflow file but each repository still must call the shared workflow with a new workflow file. Mind as well just fork the core logic and add to every repository anyways.

My proposal was to have our bot automatically have it on for every repo without any custom setup/configuration required.

The original problem is described here

As far as I understand the issue is that the web app deploy hasn't been performed in order to check how the feature works

So this issue describes a solution to create a universal workflow for web app deploys so that we wouldn't check yml config files every time there is smth wrong with the deploy

We shouldn't add the web deploy feature to the bot because:

  1. Partners might not need web app deploys (in case they have a backend or solidity or any other repo). So this feature is really applicable only to our project.
  2. This is not really the bot's task to manage deployments. Github already does a great job on this. The bot should be responsible for it's main feature: managing bounties.
0x4007 commented 1 year ago

It isn't clear to me how this will solve the original proposed problem.

https://t.me/c/1588400061/1/3729

I thought about this because the alternative is that we must be sure to manually add the CI/CD YML file to every repository OR it can “just work” if the bot is added to a repo.

web app deploy hasn't been performed

I'm unsure if I am understanding but 0xcodercrane already included the logic to automatically check if the inital deployment was created, and if not, to create a new project on Cloudflare and do the deployment. This logic is inside of the continuous-deploy.yml:54

So this issue describes a solution to create a universal workflow for web app deploys so that we wouldn't check yml config files every time there is smth wrong with the deploy

So this forces us to use the same core logic, meaning that either it should always work across all repositories or none at all. Okay that makes sense.

We shouldn't add the web deploy feature

Agreed with your points

whilefoo commented 1 year ago

/assign

ubiquibot[bot] commented 1 year ago

@whilefoo The time limit for this bounty is on Wed, 12 Jul 2023 17:49:20 GMT

It looks like you haven't set your wallet address, please use /wallet 0x4FDE...BA18 to do so. (It's required to be paid for the bounty)

whilefoo commented 1 year ago

/wallet 0xA0B11F474d8ECE1205d38c66d5F2bE8917675d60

ubiquibot[bot] commented 1 year ago

Updated the wallet address for @whilefoo successfully! Your new address: 0xA0B11F474d8ECE1205d38c66d5F2bE8917675d60

whilefoo commented 1 year ago

The comment action (thollander/actions-comment-pull-request) does not support commenting on other repos. Since this will be also used by partners, maybe it's better to leave the option of commenting to the caller workflow?

EDIT: I have found an alternative action that can do that

whilefoo commented 1 year ago

Will the reusable workflow be placed in this repo? Because this repo is a template, it will get copied over to every repo.

rndquu commented 1 year ago

Will the reusable workflow be placed in this repo? Because this repo is a template, it will get copied over to every repo.

I don't think so because https://github.com/ubiquity/ts-template was initially created both for frontend and backend while cloudflare pages (as far as I understand) supports only static html

0x4007 commented 1 year ago

it will get copied over to every repo

It does not get automatically copied over to every repo. I've made several changes to this repo and had to manually sync them on other repos.

@rndquu let's focus on the front-and-back-end support and if necessary we can make other templates for other types of projects.

whilefoo commented 1 year ago

It does not get automatically copied over to every repo.

Yes, I meant to say when somebody uses this template to create a new repo it will get copied over. Which repo should I place the reusable workflow to?

0x4007 commented 1 year ago

Which repo should I place the reusable workflow to

@rndquu should we make a new repository for this reusable workflow?

rndquu commented 1 year ago

It does not get automatically copied over to every repo.

Yes, I meant to say when somebody uses this template to create a new repo it will get copied over. Which repo should I place the reusable workflow to?

I would put it in https://github.com/ubiquity/.github

whilefoo commented 1 year ago

2. Remove old deployment workflows and apply the new reusable workflow to these repos:

I still have to do this part of the task

0x4007 commented 1 year ago

[ CLAIM 200 DAI ]

0xA0B11F4...17675d60

If you enjoy the DevPool experience, please follow Ubiquity on GitHub and star this repo to show your support. It helps a lot!

@0xcodercrane @wannacfuture why is this paid out in DAI?

0xcodercrane commented 1 year ago

[ CLAIM 200 DAI ]

0xA0B11F4...17675d60

If you enjoy the DevPool experience, please follow Ubiquity on GitHub and star this repo to show your support. It helps a lot!

@0xcodercrane @wannacfuture why is this paid out in DAI?

Looks like ts-template has no config so it seems defaults to DAI in ETH. @rndquu for confirmation

rndquu commented 1 year ago

[ CLAIM 200 DAI ]

0xA0B11F4...17675d60

If you enjoy the DevPool experience, please follow Ubiquity on GitHub and star this repo to show your support. It helps a lot!

@0xcodercrane @wannacfuture why is this paid out in DAI?

Looks like ts-template has no config so it seems defaults to DAI in ETH. @rndquu for confirmation

fixed https://github.com/ubiquity/ubiquibot-config/commit/b86562d3be15fcbebe3dd46e3b11fd7bea76f48c

whilefoo commented 1 year ago

Can you invalidate this permit and generate permit for gnosis chain?

0x4007 commented 1 year ago

Gas is extremely high so I initiated the invalidation transaction. Whenever it is completed I can generate the new payment permit on Gnosis Chain.

ubiquibot[bot] commented 1 year ago

[ CLAIM 200 WXDAI ]

0xA0B11F47...917675d60

If you enjoy the DevPool experience, please follow Ubiquity on GitHub and star this repo to show your support. It helps a lot!
0x4007 commented 1 year ago

Can you invalidate this permit and generate permit for gnosis chain?

Done @whilefoo

rndquu commented 1 year ago

@whilefoo Would you mind setting the reusable deploy for the https://github.com/ubiquity/ubiquity-dollar repo ?

whilefoo commented 1 year ago

@whilefoo Would you mind setting the reusable deploy for the https://github.com/ubiquity/ubiquity-dollar repo ?

It's already done

rndquu commented 1 year ago

@whilefoo Would you mind setting the reusable deploy for the https://github.com/ubiquity/ubiquity-dollar repo ?

It's already done

Oh, thank you, I might've missed it