β 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" :
Join Us for the 2021 GitHub Actions Hackathon on DEV!
Gracie Gregory (she/her) for The DEV Team γ» Nov 8 '21
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
π Under the hoods, domain-nc Free Rapid API is called, so you need a registration key (available for free).
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 :
π DOMAINE.nc : the fun (docker) way... and screenshots contest π¨
adriens for opt-nc γ» Apr 12 '22
API on RapidAPI marketplace :
Top comments (1)