β About
We are managing a website dedicated to domain names management (see DOMAINE.NC
).
Some months ago we faced a incident due to domain name expiration.
The impact on the business is pretty simple π
your domain is simply disappearing from the web (no more ads nor transaction revenue, no more service, SLA impacts, potential penalties,...) π±
At that time I said myself... then to my team that we absolutely had to
create something that would help anyone avoid that incident so noone should see anymore that kind of service outage
π‘ The Pitch
"We need to get a solution that warns us before domain name expiration by sending a pluggable event/notification."
π§° Our toolbox
Previously we had created an API to interact with domain names in New-Caledonia.
It is available under various flavours :
- As a public docker image :
optnc/domaine-nc-api
- On our marketplace on RapidAPI
So thanks to this, we wanted to apply βdogfoodingβ practice.
We will
create a ready to use cloud based solution so we could monitor our own domains.
ποΈ Deliver a ready to use solution
I was still remembering of "2021 GitHub Actions Hackathon on DEV" :
![The DEV Team](https://res.cloudinary.com/practicaldev/image/fetch/s--IHtLIa0T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/practicaldev/image/fetch/s--nJ87SGF6--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/organization/profile_image/1/0213bbaa-d5a1-4d25-9e7a-10c30b455af0.png)
![](https://res.cloudinary.com/practicaldev/image/fetch/s--UKgrNM3W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/practicaldev/image/fetch/s--W9v1So-5--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/342975/98b7a8ed-aa91-48a3-bcc0-ebe2c13b5893.png)
Join Us for the 2021 GitHub Actions Hackathon on DEV!
Gracie Gregory (she/her) for The DEV Team γ» Nov 8 '21 γ» 3 min read
Github actions are an efficient way to get the Job done and take advantage of all GH (ready to use) integrations around issues.
So...
we would create a public GH Action that would do the monitoring for us... making it possible to automate backoffice tasks (Power Automate, Zapier or IFTTT) :
βοΈ The GH action is relying on the API delivered through RapidAPI, so the only thing you have to do is bring your own RapidAPI key so you can store it as a secret on your GH repo
π¬ Live demo
Enjoy the demo of the solution and how to customize it :
π Source code
Find below GH Action source code :
opt-nc
/
domaine-nc-action
GitHub Action to check if your *.nc domain name is not expired and when it will be
π» domaine-nc-action
GitHub Action to check if your *.nc
domain name is not expired and when it will be.
β
Usage
Let's see an example :
on:
schedule:
- cron: '0 7 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get validity metadata for opt.nc
id: metadata
uses: opt-nc/domaine-nc-action@v1
with:
api-key: ${{ secrets.RAPID_API_KEY }}
name: opt
- name: Send a message to Slack if domain expires within 5 days
if: ${{ steps.metadata.outputs.daysBeforeExpiration < 5 }}
uses: bryannice/gitactions-slack-notification@2.0.0
env:
SLACK_INCOMING_WEBHOOK: ${{ secrets.SLACK_INCOMING_WEBHOOK }}
SLACK_MESSAGE: opt.nc will expires in less than 5 days
SLACK_TITLE: Domain name expiration reminder
In this example, a Slack message is send basedβ¦
... and finally the Action on the Marketplace.
π Related contents
Previous related POST :
![opt-nc](https://res.cloudinary.com/practicaldev/image/fetch/s--akFu7-GX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/practicaldev/image/fetch/s--0QsNl5GP--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/organization/profile_image/5458/98dc3bfe-45f7-48c6-a182-21944edf46b6.jpg)
![](https://res.cloudinary.com/practicaldev/image/fetch/s--uIgDHfBs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/practicaldev/image/fetch/s--qsqU1oih--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/446871/3e9ded5c-f368-4906-a277-35e56c9f97a7.png)
π DOMAINE.nc : the fun (docker) way... and screenshots contest π¨
adriens for opt-nc γ» Apr 12 '22 γ» 2 min read
API on RapidAPI marketplace :
Top comments (1)