Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
2c35b14
adding badge
brown9804 Jul 10, 2025
ef9e7bf
Merge 2c35b148f6030d907dda2086fe141e37adc5f2a5 into f0be17d53f77716d9…
brown9804 Jul 10, 2025
97b43ab
Update last modified date in Markdown files
brown9804 Jul 10, 2025
f09f3e0
adding pr also
brown9804 Jul 10, 2025
c038d7c
Merge f09f3e0326c35a97706476944f43ee17375b7d7c into f0be17d53f77716d9…
brown9804 Jul 10, 2025
6a19128
testing npm
brown9804 Jul 10, 2025
baa9af1
Merge 6a19128c3759ebd0d2639b397bc4d2d865d1bb29 into f0be17d53f77716d9…
brown9804 Jul 10, 2025
ec42b6b
verification step +
brown9804 Jul 10, 2025
f31760d
Merge ec42b6b814670039f67a29d2ea5fd7df59bfe359 into f0be17d53f77716d9…
brown9804 Jul 10, 2025
4fc2b7f
Delete .github/workflows/update-metrics.yml
brown9804 Jul 10, 2025
3a55b56
Merge 4fc2b7fb7f0686efe809a2ed959af8b9feca6b02 into f0be17d53f77716d9…
brown9804 Jul 10, 2025
8fe85d0
modified logic
brown9804 Jul 10, 2025
3b3940e
Merge 8fe85d0ab814525fe6f6058025bf9192a17dc421 into f0be17d53f77716d9…
brown9804 Jul 10, 2025
c8813de
testing metrics.json creation
brown9804 Jul 10, 2025
afcd51b
Merge c8813de749f0a6d451119b286d88eb807420765a into f0be17d53f77716d9…
brown9804 Jul 10, 2025
c2fcbc2
use as engine in your pipeline
brown9804 Jul 10, 2025
a3358d5
Merge c2fcbc2e53d37fc27b51f7c43e07556fb08c3d16 into f0be17d53f77716d9…
brown9804 Jul 10, 2025
8b7c8b6
trying temporary approach
brown9804 Jul 10, 2025
a68855a
Merge 8b7c8b68f4979d5ea7772909f73d32ff9c2abc17 into f0be17d53f77716d9…
brown9804 Jul 10, 2025
99652e6
dynamic changes
brown9804 Jul 10, 2025
9d10c58
Merge 99652e6bd4d67167c5f29192d0f65d3d094597ee into f0be17d53f77716d9…
brown9804 Jul 10, 2025
b7f37f9
temp repo added
brown9804 Jul 10, 2025
36804b5
Merge b7f37f94d009cf5aae896dee5efced7de04e15ba into f0be17d53f77716d9…
brown9804 Jul 10, 2025
b825657
Update visitor count
github-actions[bot] Jul 10, 2025
5488956
handle pull requests differently
brown9804 Jul 10, 2025
605057c
Merge 5488956ee1861a4da7cc277cad85693ff08e7085 into f0be17d53f77716d9…
brown9804 Jul 10, 2025
94797d5
Update visitor count
github-actions[bot] Jul 10, 2025
c73b791
if formatted
brown9804 Jul 10, 2025
1c906ab
Merge c73b79100d79d75438b523d4527a39a3d17a75cf into f0be17d53f77716d9…
brown9804 Jul 10, 2025
93c0dc7
Update visitor count
github-actions[bot] Jul 10, 2025
f34f041
testing conditions
brown9804 Jul 10, 2025
7f232fb
Merge f34f041b0b6a906c90b4250a1f3a5def5fdc8675 into f0be17d53f77716d9…
brown9804 Jul 10, 2025
64b7dce
Merge 7f232fbc3c11dbadbd92122ac7f890bb60de5a49 into f0be17d53f77716d9…
brown9804 Jul 10, 2025
870be56
Deploy static HTML files
github-actions[bot] Jul 10, 2025
14e6203
pull remote changes before push
brown9804 Jul 10, 2025
3091542
Update visitor count
github-actions[bot] Jul 10, 2025
9ef23d5
pull before push
brown9804 Jul 10, 2025
e7ae327
Update visitor count
github-actions[bot] Jul 10, 2025
40a75bb
adding conflict logic
brown9804 Jul 10, 2025
1760cad
Update visitor count
github-actions[bot] Jul 10, 2025
eaa8a20
Skip Conflicting Commits:
brown9804 Jul 10, 2025
3dfef39
Update visitor count
github-actions[bot] Jul 10, 2025
81562c3
rebase if
brown9804 Jul 10, 2025
f7fb261
Update visitor count
github-actions[bot] Jul 10, 2025
ff35b9d
use counter
brown9804 Jul 10, 2025
fc9135a
Update visitor count
github-actions[bot] Jul 10, 2025
885c6fa
waiting
brown9804 Jul 10, 2025
09b48bf
Update visitor count
github-actions[bot] Jul 10, 2025
b2ae301
adding lock
brown9804 Jul 10, 2025
e5bb791
cleaning
brown9804 Jul 10, 2025
25d421c
Update visitor count
github-actions[bot] Jul 10, 2025
66c5601
Conflict Resolution
brown9804 Jul 10, 2025
6c9eb47
Update visitor count
github-actions[bot] Jul 10, 2025
6c91afe
Push to the Correct Branch
brown9804 Jul 10, 2025
dec35e2
Update visitor count
github-actions[bot] Jul 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 27 additions & 19 deletions .github/workflows/md-html-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main

# push:
# branches:
# - main # Trigger the workflow on push to the main branch
Expand All @@ -19,21 +20,30 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

# Step 2: Set up Node.js environment
# Step 2: Check for lock file
- name: Check for lock file
run: |
if [ -f .lock ]; then
echo "Another workflow is running. Exiting."
exit 1
fi
touch .lock

# Step 3: Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14' # Specify the Node.js version

# Step 3: Install npm dependencies
# Step 4: Install npm dependencies
- name: Install dependencies
run: npm install

# Step 4: Install pandoc for Markdown to HTML conversion
# Step 5: Install pandoc for Markdown to HTML conversion
- name: Install pandoc
run: sudo apt-get install -y pandoc

# Step 5: Convert all Markdown files to HTML while preserving directory structure
# Step 6: Convert all Markdown files to HTML while preserving directory structure
- name: Convert Markdown to HTML
run: |
mkdir -p _site # Create the _site directory if it doesn't exist
Expand All @@ -45,29 +55,27 @@ jobs:
pandoc "$file" --standalone --toc -o "_site/${file%.md}.html"
done

# Step 6: Deploy the generated HTML files to GitHub Pages
# Step 7: Deploy the generated HTML files to GitHub Pages
- name: Deploy to GitHub Pages
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Configure Git with a bot email and name
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# Check for local changes and stash them if present
if [ -n "$(git status --porcelain)" ]; then
git stash
git pull origin ${{ github.ref }} --rebase
git stash pop || true # Ignore error if no stash entries to pop
else
git pull origin ${{ github.ref }} --rebase
fi
# Add all changes, including untracked files
# Ensure all changes are staged
git add -A
# Check for changes before committing
# Commit changes if there are any
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
exit 0
else
# Commit the changes
git commit -m 'Deploy static HTML files'
# Push the changes to the remote branch
git push origin HEAD:${{ github.ref }}
fi
# Push changes to the pull request branch
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
git push origin HEAD:${{ github.event.pull_request.head.ref }} || echo "Push failed due to conflicts"

# Step 8: Remove lock file
- name: Remove lock file
if: always()
run: rm -f .lock
7 changes: 6 additions & 1 deletion .github/workflows/update-md-date.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install dependencies
run: pip install python-dateutil

- name: Configure Git
- name: Configure Git
run: |
git config --global user.email "belindabrownr04@gmail.com"
git config --global user.name "brown9804"
Expand All @@ -32,7 +32,12 @@ jobs:
run: python .github/workflows/update_date.py

- name: Commit changes
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git fetch origin
git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed"
git add -A
git commit -m "Update last modified date in Markdown files" || echo "No changes to commit"
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
git push origin HEAD:${{ github.event.pull_request.head.ref }}
93 changes: 93 additions & 0 deletions .github/workflows/use-visitor-counter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Use Visitor Counter Logic

on:
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
workflow_dispatch: # Allows manual triggering

permissions:
contents: write
pull-requests: write

jobs:
use-counter-logic:
runs-on: ubuntu-latest

steps:
- name: Checkout current repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Clone github-visitor-counter repository temporarily
run: git clone https://github.com/brown9804/github-visitor-counter.git

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies for github-visitor-counter
run: |
cd github-visitor-counter
npm install

- name: Run visitor counter logic
run: |
cd github-visitor-counter
node update_repo_views_counter.js
env:
TRAFFIC_TOKEN: ${{ secrets.TRAFFIC_TOKEN }}
REPO: ${{ github.repository }}

- name: Move generated files to current repository
run: |
mv github-visitor-counter/metrics.json .
mv github-visitor-counter/README.md .

- name: Clean up temporary files
run: rm -rf github-visitor-counter

- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Commit and push to PR branch
if: github.event_name == 'pull_request'
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git fetch origin
git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }}
git add README.md metrics.json
git commit -m "Update visitor count" || echo "No changes to commit"
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed"
git push origin HEAD:${{ github.event.pull_request.head.ref }}

- name: Commit and push to new branch (non-PR)
if: github.event_name != 'pull_request'
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git fetch origin
git checkout ${{ github.event.pull_request.head.ref }} || git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }}
git add README.md metrics.json
git commit -m "Update visitor count" || echo "No changes to commit"
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed"
git push origin HEAD:${{ github.event.pull_request.head.ref }}

- name: Create Pull Request (non-PR)
if: github.event_name != 'pull_request'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-visitor-count
title: "Update visitor count"
body: "Automated update of visitor count"
base: main
156 changes: 88 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,99 @@
# Cloud DevOps: <br> Learning Path - Overview
# Open Source Visitor Counter

Costa Rica

[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com)
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2024-12-13
Last updated: 2025-07-10

----------

> Provides the essential knowledge required to work effectively within Azure and embrace DevOps/Agile methodologies. Additionally, it offers insights into fundamental cloud concepts.

<details>
<summary><b>Table of Contents</b> (Click to expand)</summary>

- [Agile](https://github.com/brown9804/SDLC-Cloud_Lpath/tree/main/Agile)
- [DevOps](https://github.com/brown9804/SDLC-Cloud_Lpath/tree/main/DevOps)
- [Network](https://github.com/brown9804/SDLC-Cloud_Lpath/tree/main/Network)
- [GitHub](https://github.com/brown9804/CloudDevOps_LPath/tree/main/GitHub)
- [Cloud Principles](https://github.com/brown9804/SDLC-Cloud_Lpath/tree/main/Cloud)
- [0. Linux](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux)
- [Working with Users and Permissions](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux/lab0)
- [System Service Management, Runlevels and Boot Targets](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux/lab1)
- [Securely Accessing Your System](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux/lab2)
- [Package Management and Troubleshooting](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux/lab3)
- [File Management, Permissions and Backup](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux/lab4)
- [Working with Text Files and Streams](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux/lab5)
- [Linux Device Management](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux/lab6)
- [The Linux Shell](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux/lab7)
- [Networking](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux/lab8)
- [Processes Management](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/0-linux/lab9)
- [1. Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform)
- [Installing Terraform and Working with Terraform Providers](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab0)
- [Using Terraform CLI Commands (workspace and state) to Manipulate a Terraform Deployment](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab1)
- [Building and Testing a Basic Terraform Module](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab2)
- [Exploring Terraform State Functionality](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab3)
- [Deploy an Azure Storage Account with Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab4)
- [Deploy an Azure File Share and Blob Storage with Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab5)
- [Deploy Azure VNETs and Subnets with Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab6)
- [Create Azure NSGs with Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab7)
- [Deploying an Azure VM with Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab8)
- [Deploy a Web Application with Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab9)
- [Deploy a MySQL Database with Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_10)
- [Migrating Terraform State to Terraform Cloud](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_11)
- [Using Terraform Provisioners to Set Up an Apache Web Server on AWS](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_12)
- [Make Changes to AWS Infrastructure Using Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_13)
- [Use Output Variables to Query Data in AWS Using Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_14)
- [Make Changes to Azure Infrastructure Using Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_15)
- [Use Output Variables to Query Data in Azure Using Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_16)
- [Use Terraform to Create a Kubernetes Deployment](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_17)
- [Manage Kubernetes Resources with Terraform](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_18)
- [Use Terraform to Create an EKS Deployment](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_19)
- [Troubleshooting a Terraform Deployment](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/1-terraform/lab_20)

- [Automation Principles](https://github.com/brown9804/SDLC-Cloud_Lpath/tree/main/Cloud/2-automation_principles)
- [Kubernetes Principles](https://github.com/brown9804/SDLC-Cloud_Lpath/tree/main/Cloud/3-kubernetes_principles)

</details>

## Overview

- SDLC - [What is and how it works](https://agilie.com/blog/what-is-the-software-development-life-cycle-sdlc-and-how-does-it-work)

![image](https://github.com/brown9804/SDLC-Cloud_Lpath/assets/24630902/e809d790-87d4-41a1-b9ea-071327ab6ef2)

![Benefits](https://github.com/brown9804/SDLC-Cloud_Lpath/assets/24630902/dc014629-a069-44f3-b657-7f8d39968272)

![image](https://github.com/brown9804/SDLC-Cloud_Lpath/assets/24630902/a3b6522f-88c2-4ede-a477-09280f5584b9)

- SDLC - [Methodologies](https://datarob.com/sdlc-methodologies/)

![image](https://github.com/brown9804/SDLC-Cloud_Lpath/assets/24630902/5ba714af-4238-48d3-9043-cbcd64a590f1)


> This repository provides a customizable GitHub visitor counter that tracks and displays the number of visits to your GitHub profile or repository. The counter updates daily using the GitHub Traffic API and writes the total views directly into the README file.

## Features

- **Daily-updated visitor counting**: Fetches real visitor data from the GitHub Traffic API.
- **Markdown-based display**: Updates the README file with the total visitor count.
- **Open source and customizable**.

## How it works

> [!IMPORTANT]
> This counter is updated once per day (not real-time) and shows the total number of visits (including repeat visits) as reported by GitHub.

- A GitHub Action workflow runs daily to fetch visitor data from the GitHub Traffic API.
- The action updates the `README.md` file with the total visitor count and the refresh timestamp.

## How to use it

1. **Add the Badge to Your Repository**: Include the following markdown in your `README.md` file, between the `START BADGE` and `END BADGE` (included), as shown in the bottom.
2. **Create a Personal Access Token**:
- Go to **GitHub Settings** > **Developer Settings** > **Personal Access Tokens**.
- Generate a new token with `repo` access.
3. **Save the Token as a Secret**:
- In your repository, navigate to **Settings** > **Secrets and Variables** > **Actions**.
- Add a new secret named `TRAFFIC_TOKEN` and paste the generated token.
4. **Add the Pipeline**: This single pipeline will fetch the visitor count, update the badge in the `README.md` file, and push the changes back to the repository.
- Create a GitHub Actions workflow (`update-metrics.yml`) in your repository to handle the visitor counter logic.
- Use the following content for the workflow:

```yaml
name: Update Visitor Counter

on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
workflow_dispatch: # Allows manual triggering

jobs:
update-counter:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install dependencies
run: npm install @brown9804/github-visitor-counter

- name: Run visitor counter script
run: node node_modules/@brown9804/github-visitor-counter/update_repo_views_counter.js
env:
TRAFFIC_TOKEN: ${{ secrets.TRAFFIC_TOKEN }}
REPO: ${{ github.repository }}

- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add README.md metrics.json
git commit -m "Update visitor count"
git push
```

## Files structure

- `README.md`: Contains instructions and displays the visitor count badge.
- `update_repo_views_counter.js`: Script to fetch visitor count data from the GitHub Traffic API and update the `README.md` file.
- `package.json`: Defines dependencies and scripts for the project.
- `LICENSE`: Specifies the license for the project.

> [!IMPORTANT]
>
> - Replace `<main-repo-owner>` and `<main-repo-name>` with your actual values.
> - Use a Personal Access Token (PAT) with `repo` access as `TRAFFIC_TOKEN` secret in each target repository.
> - The action will trigger the visitor counter logic in the main repository and update the badge dynamically.

<!-- START BADGE -->
<div align="center">
<h3 style="color: #4CAF50;">Total Visitors</h3>
<img src="https://profile-counter.glitch.me/brown9804/count.svg" alt="Visitor Count" style="border: 2px solid #4CAF50; border-radius: 5px; padding: 5px;"/>
<img src="https://img.shields.io/badge/Total%20views-195-limegreen" alt="Total views">
<p>Refresh Date: 2025-07-10</p>
</div>
<!-- END BADGE -->
Loading