zackify / cli.rs

use {yourproject}.cli.rs!
https://cli.rs
334 stars 48 forks source link

Improve the workflow for Cleanup and DNS Record Management #50

Open exil0867 opened 1 year ago

exil0867 commented 1 year ago

Hello!

I have been examining the GitHub Actions workflow for creating CNAME records in the cli.rs project and noticed a few areas that could benefit from improvements, specifically regarding cleanup, scalability, and the ability to update existing CNAME records. I would like to contribute to the project by addressing these issues.

Example:

Currently, users cannot update their subdomain CNAME value due to the workflow's limitations. For instance, if a user wants to change the CNAME value for their subdomain (e.g., from old-value.github.io to new-value.github.io), the workflow will attempt to create a new DNS record with the updated value. However, DigitalOcean rejects the addition of a DNS record that already exists, resulting in a silent error in the logs, and the CNAME value remains unchanged.

To resolve this issue, I propose the following improvements:

  1. Cleanup: Implement a mechanism within the workflow that checks for deleted or modified files in the domains directory and performs the necessary cleanup actions on DigitalOcean. This will ensure that the DNS records stay up-to-date with the repository state.

  2. Enhance the workflow to support updating existing CNAME values, deleting records, and creating new ones by detecting changes and using the appropriate DigitalOcean CLI commands to update the DNS records accordingly. Currently, the workflow does not handle the removal or modification of existing DNS records. If a subdomain needs to be removed or updated, it would need to be done manually.

The improvements I am planning to implement would make use of the following DigitalOcean CLI commands:

I believe these improvements will help ensure that the cli.rs project continues to serve the Rust community effectively as it grows. I would appreciate any feedback or suggestions you might have, and I am ready to submit a pull request with the proposed changes once we agree on the best approach.

Please note that I will be testing the changes carefully in my fork before opening pull requests to ensure the updated workflow functions as expected.

I am looking forward to contributing to this project and helping to enhance it. Please let me know if my PRs will be welcomed 😁.