An open API service indexing awesome lists of open source software.

https://github.com/georges034302/azure-acr-demo

A practical demo using Azure Container Instances (ACI) + Azure Container Registry (ACR) with GitHub Actions for CI/CD
https://github.com/georges034302/azure-acr-demo

azure-container-instances azure-container-registry bash docker github-actions python

Last synced: 3 months ago
JSON representation

A practical demo using Azure Container Instances (ACI) + Azure Container Registry (ACR) with GitHub Actions for CI/CD

Awesome Lists containing this project

README

          

## ๐Ÿš€ Word Count CI/CD with ACR + ACI + GitHub Actions
_This project demonstrates a complete CI/CD pipeline using **Azure Container Registry (ACR)**, **Azure Container Instances (ACI)**, and **GitHub Actions**, triggered by changes to a data file._

### ๐Ÿ“Œ Project Highlights:
- โš™๏ธ Integration: Fully integrates (GitHub Actions + ACR + ACI) CI/CD pipeline.
- ๐Ÿ” Setup: Configure Azure (Resource Group, ACR, Service Principal) and set GitHub Actions secrets.
- ๐Ÿงช Demo App: A Python script counts words in specific data.txt
- ๐Ÿ› ๏ธ Automation: GitHub Actions runs the entire pipeline using Bash and Python scripts.
- ๐Ÿณ Docker Build: A custom Docker image is built on every change and pushed to ACR.
- ๐Ÿš€ Deployment: The container is automatically deployed to ACI.
- ๐Ÿ”„ Trigger: The CI/CD workflow is triggered by changes to specific data.txt.
- โœ… Sucess: Dynamically update `index.html` with the word count
- ๐ŸŒ Live Output: The updated word count is viewable at a public URL (FQDN) after deployment.

---

### ๐Ÿ“ Project Structure

.github/workflows/\
โ”‚\
โ”œโ”€โ”€ apps/\
โ”‚ โ€‚โ€‚โ€‚โ””โ”€โ”€ app.py
โ”œโ”€โ”€ scripts/\
โ”‚ โ€‚โ€‚โ€‚โ”œโ”€โ”€ setup.sh (One-time script - initialization)

โ”‚ โ€‚โ€‚โ€‚โ”œโ”€โ”€ gh_setup.sh (One-time script - initialization)
โ”‚ โ€‚โ€‚โ€‚โ”œโ”€โ”€ update_html.sh\
โ”‚ โ€‚โ€‚โ€‚โ”œโ”€โ”€ deploy.sh
โ”‚ โ€‚โ€‚โ€‚โ”œโ”€โ”€ entrypoint.sh

โ”‚ โ€‚โ€‚โ€‚โ””โ”€โ”€ cleanup.sh (One-time script - cleanup azure resources)
โ”œโ”€โ”€ ci.yml
โ””โ”€โ”€ deploy.yml

index.html
data.txt
Dockerfile\
.gitignore

---
### ๐Ÿงฐ Stack Overview
- Cloud: Azure Container Registry (ACR)
- Cloud: Azure Container Instances (ACI)
- CI/CD: GitHub Actions
- Deployment Tool: Bash scripts & Azure CLI
- App Example: Python word count app served via Python HTTP server
- CLI Tools: az, gh, docker
---

### ๐Ÿš€ How to Deploy

1. **Install dependencies**
```
chmod +x setup.sh
./.github/scripts/setup.sh
```

2. **Run the deployment**
```
chmod +x deploy.sh
./.github/scripts/deploy.sh
```

* โœ… Example Output:

๐ŸŒ Live App Access (FQDN): http://\.\.azurecontainer.io
---

### ๐Ÿงน Cleanup

To delete Azure resources:
```
chmod +x cleanup.sh
./.github/scripts/cleanup.sh
```
---

### ๐Ÿ‘จโ€๐Ÿ’ป Author: Georges Bou Ghantous

This repository demonstrates automated deployment of a Python app to ACI+ACR using GitHub Actions. ๐Ÿ’™