Website Template Automation #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Clone Website Templates and Add Ads | |
on: | |
workflow_dispatch: # Allows manual triggering of the workflow with inputs | |
inputs: | |
git-url: | |
description: 'GitHub Repository URL to clone (Leave empty for default)' | |
required: false # Optional input | |
default: 'https://github.com/learning-zone/website-templates.git' # Default URL | |
jobs: | |
clone-repository: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the current repository | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
# Step 2: Set up Python environment | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
# Step 3: Install dependencies and run the clone_and_add_ads.py script | |
- name: Clone Repository and Add Ads | |
run: | | |
python clone_and_add_ads.py "${{ github.event.inputs.git-url }}" | |
# Step 4: Commit and push changes to repository | |
- name: Commit and Push Changes | |
run: | | |
git config --global user.name "Rekt-Developer" | |
git config --global user.email "[email protected]" | |
git add . | |
git commit -m "Cloned and added ads to website-templates" | |
git push origin main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |