Joey40 / NiceGuiTest

A small example of NiceGUI running on Azure Container Apps, deployed via GitHub Actions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NiceGUI Test

Testting the NiceGUI for Python. Running on an Azure Web App deployed with GitHub Actions.

Azure Integration

In order for Terraform to be able to connect to Azure you'll need to create a service principal along with a secret. Once you create the service principal add the following secrets to your Github Repo under Repo Settings > Secrets and variables > Actions:

  • AZURE_CLIENT_ID
  • AZURE_CLIENT_SECRET
  • AZURE_SUBSCRIPTION_ID
  • AZURE_TENANT_ID

Github Actions

There are several workflows in this template which can be found under ./.github/workflows. Keep in mind these are very simple examples meant for my lab, and would not be appropriate for most production deployments.

Terraform-destroy.yml

This workflow installs Terraform and then runs terraform destory. This is helpful for cleaning up lab environemnts so you don't get billed for something you're not using.

Terraform-docs.yml

This workflow used a pre-built action to run Terraform Docs. There is a config file located in the ./terraform directory which allows for customization. This action also supports more advanced configurations such as nested modules and Atlantis files. This workflow runs on any pull request and ensures that documentation markdown is generated before merging the pull request.

Terraform-plan-apply.yml

This is the core worklfow which actually applies the IaC (Infrastructure as Code) using Terraform. This workflow performs a number of actions:

  1. TFLint - This step runs a pre-built github action that runs TFLint and leaves appropriate comments directly on the code in the pull-request. reviewdog/action-tflint@master
  2. Terraform Format
  3. Terraform Validate
  4. Terraform Init
  5. Terraform Plan
  6. PR Comment Script - This step runs a custom bash script based on a script provided by Hashicorp. The script takes the output from the previous steps including the full Terraform Plan output and submits them as a comment on the PR for easy review.
  7. Terraform Apply - Once the PR has been merged into the main branch (or upon any commit directly to the main branch) the final action is to run Terraform Apply. This step will only run if the Terraform Plan step was successful.

Terraform Docs

The output from Terrform Docs can be found: here

References

  1. GitHub Actions
  2. Terraform
  3. Terraform Docs
  4. Terraform Linter
  5. Markdown

About

A small example of NiceGUI running on Azure Container Apps, deployed via GitHub Actions.


Languages

Language:HCL 62.6%Language:Python 35.4%Language:Dockerfile 2.0%