Blog

Effortless Deployment: Launching Your BoxLang Miniserver!

Maria Jose Herrera July 23, 2024

Spread the word

Maria Jose Herrera

July 23, 2024

Spread the word


Share your thoughts

Deploying a BoxLang Miniserver Website to Render.com Using Github Actions

Deploying a BoxLang mini-server website to Render.com can be straightforward and efficient when using a Docker image built with GitHub Actions. This Guest blog post is presented to you by one of our amazing community members Daniel Mejía, who will guide you through the process, detailing each step to ensure a smooth deployment.

Quick Overview

The deployment process allows you to commit changes to your website code on GitHub. The GitHub action will automatically build the container image and push it to the GitHub Container Registry. Finally, an HTTP GET request to the Render.com redeploy webhook deploys the container image with the latest code changes. The entire process, from committing on your machine to a live deployment on Render.com, takes about 90 seconds!

Why is this Relevant to You?

  • Cost-Effective: Github is free, Github Container Registry is free, and the free tier on Render.com provides 0.1 CPU and 512MB RAM. Although it shuts down after 8 minutes of inactivity, the startup time is only about 45 seconds. This setup is ideal for a hobby web app with zero users.
  • Simplicity: This method requires minimal configuration and no credit card, making it accessible and easy to implement.

Requirements

  • GitHub Account github.com
  • Render.com Account
  • Any secrets vault (Keepersecurity.com/vault is recommended)

Steps to Configure and Deploy

  1. Create a GitHub Personal Access Token
    • Click on Profile picture and then Settings, then Developer Settings, then create a Classic Token.
    • Save this token in your secrets vault.

  1. Create an empty github project on github.com

  1. Create a new Repository Secret
    • Go to your repository on github.com, then Settings. Then go to Actions under Secrets and Variables. Create a new repository secret - give it the name GH_PAT and the value should be your Personal Access Token you created in step 1.

  1. Create Your "Hello World" app
    • Create a new folder/project on your development machine.
    • At the root of your project create an index.bmx file. Add your html to this file and save it.

  1. Create a file named dockerfile (no extension, no periods) at the root of your project.

FROM ortussolutions/boxlang:miniserver-alpine
RUN rm /app/* -r 
COPY ./ /app


  1. Create a .github/workflows/publish-container.yaml (two folders deep)

name: Docker Image CI for GHCR Boxlang

on:
  push

jobs: 
  build_and_publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build and push the image
        run: |
          docker login --username <github-username-goes-here> --password ${Setting: {secrets.GH_PAT not found}} ghcr.io
          docker build . --tag ghcr.io/<github-name-goes-here>/<image-name-goes-here>:latest
          docker push ghcr.io/<github-name-goes-here>/<image-name-goes-here>:latest
      - name: Render.com Redeploy Webhook
        uses: fjogeleit/http-request-action@v1
        with:
          url: 'https://google.com'
          method: 'GET'

  1. Git commit and push your code up to github.com
    • This will start an action under your project’s Actions. The part that builds the docker container and pushes it to ghcr.io should succeed. The part for Render.com will fail.

  1. Create an account at Render.com
    • Create a New Web Service. Use the "Existing Image" option. The URL of your image will be "https://ghcr.io//:". For example, mine is: ghcr.io/webmandman/hello-world-ghcr
    • The image is private by default, so you must supply your GitHub personal access token.

  1. Get Your Render.com Redeploy URL
    • Go to the settings of your new service. Look for Redeploy Hook. Save this URL to your publish-container.yaml file, replacing the google.com URL.

  1. Git commit and push your code up to github.com
    • This time, watch every part of the Action succeed and then head over to Render.com. Under your web service Events tab you’ll see the status of the deployment. Once it succeeds you can visit your web app at the URL provided by Render.com. Mine is https://hello-world-ghcr-latest.onrender.com/

Note: The cold start of this web app is about 45 seconds - that is pretty slow, but then again it’s free and you don't need a credit card. You can upgrade your service anytime if you want zero downtime.

Conclusion

This method is as simple as it gets, whether or not you use GitHub Container Registry or Render.com It should be similar to other modern services, requiring only two configuration files and two service accounts. This streamlined process, with no credit card required, makes deploying a BoxLang Miniserver website accessible and efficient for all.

By following these steps, you can achieve an efficient deployment workflow, ensuring your BoxLang Miniserver website is live and up-to-date with minimal effort.

Guest Writer: Daniel Mejía

Who is responsible for this useful information for all? This amazing blog post has been crafted for all of us by Daniel Mejía a Web Applications Development Manager at Psomas. with a demonstrated history of working in IT for the civil engineering industry, and personal care e-commerce industry. Advanced proficiency in Javascript, HTML, CSS, ColdFusion, and SQL - all of which are backed by at least 8+ years of experience. Expert in creating full-stack applications for enterprises and consumers. Learn More


Happy deploying!

Add Your Comment

Recent Entries

Ortus Solutions Brings Innovation with BoxLang as Platinum Sponsor and Keynote Presenter at CFCamp 2025!

Ortus Solutions Brings Innovation with BoxLang as Platinum Sponsor and Keynote Presenter at CFCamp 2025!

Join us for groundbreaking workshops and discover the future of modern development with BoxLang.

Ortus Solutions is thrilled to announce its participation as a Platinum Sponsor and Keynote Presenter at CFCamp 2025, the premier conference for modern web development! Held at the Atomis Hotel Munich Airport by Mercure in Oberding, Germany, on May 22–23, 2025, this event is a must-attend for developers and tech enthusiasts.

As the...

Cristobal Escobar
Cristobal Escobar
December 03, 2024
BoxLang Monthly Newsletter - November Recap 2024

BoxLang Monthly Newsletter - November Recap 2024

This month, we’re excited to share the latest developments, updates, and opportunities from the BoxLang ecosystem. From groundbreaking beta releases to insightful new tools and community highlights, there’s something for every modern web developer.

Dive into our November Recap to explore how BoxLang is shaping the future of web development and discover ways to get involved. Don’t miss exclusive content, upcoming events, and special offers designed to keep you ahead of the curve in the JVM ecosystem.

Maria Jose Herrera
Maria Jose Herrera
December 02, 2024
How a ColdFusion Security Audit Can Protect Your Business from Data Breaches

How a ColdFusion Security Audit Can Protect Your Business from Data Breaches

In today’s digital landscape, security threats are evolving at an alarming rate, and your business’s ColdFusion application—whether powered by Lucee or Adobe ColdFusion—may be more vulnerable than you think. A comprehensive ColdFusion security audit is essential to safeguarding sensitive data, maintaining compliance, and protecting your organization from potential cyberattacks.

Why is a ColdFusion Security Audit Critical?

Security should be a top priority for any business oper...

Cristobal Escobar
Cristobal Escobar
December 02, 2024