← Back to Blog

Automatically Deploying a Service on Bizfly App Engine Using GitHub Actions

This post walks through integrating the Webhook Deploy feature on Bizfly App Engine to automatically deploy an application using GitHub Actions. The goal: every time you push new code to a GitHub repo, App Engine gets the request and deploys the new version from that source code.

The Webhook Deploy feature helps you:

  • Quickly ship a new version to users
  • Automate the update process

Step 1: Enable the Webhook Deploy feature

To enable Webhook Deploy, go to the Service on Bizfly App Engine and choose Details.

This page contains info about the service, including Webhook Deploy. Click the toggle in the Webhook Deploy section to enable it. It's off by default.

Once enabled, you'll get a Webhook URL. This is the URL you'll use to send a POST request to, to deploy a new version for the service.

The system authenticates the new-version deployment request via a TOKEN field attached to the request. Never share this Webhook URL with anyone. Anyone with the Token can request a redeploy of a new version for the service.

You can hit the button next to the URL to generate a new token. Once you generate a new token, update it wherever Webhook Deploy is being used.

Step 2: Create a secret in your GitHub repo

To integrate Webhook Deploy for a repository on GitHub, create a Secret in the repository to store the Webhook URL:

In the repository, choose SettingsSecrets and variablesActionsNew repository secret

Create a new Secret, name it WEBHOOK_URL and enter the value from the service's Webhook URL from Step 1, then hit Add Secret.

Step 3: Configure GitHub Actions

Create a file .github/workflows/deploy.yml in the repository with the content:

name: Sample Github CD for Bizfly App Engine

on:
  push:
    branches: [ "master" ]  # Triggers the jobs below on a push event to the master branch

jobs:
  deploy:
    runs-on: ubuntu-latest  # Uses an Ubuntu OS runner
    steps:
      - name: Trigger deploy in Bizfly App Engine
        run: curl -X POST ${{ secrets.WEBHOOK_URL }} # Sends a POST request via curl

The deploy.yaml file sends a request via the POST method to the service's Webhook URL on Bizfly App Engine whenever there's a push event to the master branch. The ${{ secrets.WEBHOOK_URL }} gets replaced with the actual Webhook URL when the Job runs.

Once configured successfully, push code to the master branch to check the result.

In the repository's Actions section, you'll see a job run named Sample Github CD for Bizfly App Engine.

Looking at each job's details, you'll see the deploy job ran with a returned status_code of 200, meaning the new-version deployment request succeeded.

Going back to the service's admin page on Bizfly App Engine, you'll see a new version has been deployed.

From now on, every change on the master branch will automatically get the Service running on App Engine redeployed.

Wrapping up

Thanks for reading all the way through. Bizfly App Engine is a newly developed multi-language application deployment platform, currently free to deploy applications on. You can create an account and try it out. There are also more guides for deploying various applications in the BizflyCloud App Engine Tutorials Series

Any feedback is valuable to us — feel free to reach me directly on Telegram @HoangViet12 to share feedback or request support. Follow and Up Vote if this post helped or if you want to catch more posts.

Have thoughts on this?

I'd love to hear your perspective. Send me a message.

Get in touch