MattIPv4 / DNS-over-Discord

1.1.1.1 works from a Discord server, thanks to the 1.1.1.1 bot. Invite the bot to your Discord server to start using DNS over Discord.
https://dns-over-discord.v4.wtf/invite
Apache License 2.0
275 stars 27 forks source link

Deploy via GitHub Actions #43

Closed MattIPv4 closed 2 years ago

MattIPv4 commented 2 years ago

Create a GitHub Actions workflow the runs on pushes to a branch named production. This workflow should deploy the production environment of the worker to Cloudflare.

As a follow-up, once this initial workflow has been created, duplicate it for a branch named staging, and have it deploy the staging environment of the worker to Cloudflare.

mohan-13 commented 2 years ago

Hello ! I would like to pick up this ? Could you please assign me to this? Thanks

MattIPv4 commented 2 years ago

Sure thing

MattIPv4 commented 2 years ago

For reference, I imagine you'll want to utilise https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler

mohan-13 commented 2 years ago

Yup! Thanks. I will get started and we shall discuss if I need something here.

mohan-13 commented 2 years ago

I am new to Wrangler. Can you please confirm whether I need to create respective .env file before deployment ? If needed then I can pick it up from Github Secrets right ?

MattIPv4 commented 2 years ago

Yes, the .env file will need to be created. And yeah, building it from GitHub Secrets seems like the best approach

MattIPv4 commented 2 years ago

Alternatively, you could change the Webpack script to inject the full env, and then just use the environment directly without the .env file: https://github.com/MattIPv4/DNS-over-Discord/blob/6c457254930c705b347fa8ab69589b7fb7bfcd0d/webpack.config.js#L15