my-devops-client/.gitea/workflows/deploy.yml

32 lines
936 B
YAML

name: Production Deployment Pipeline
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install Docker CLI and Compose
run: |
apt-get update
apt-get install -y docker.io docker-compose-v2
- name: Deploy Hello World Application
run: |
docker pull nginxdemos/hello:plain-text
docker compose -f ./stacks/hello-world/docker-compose.yml up -d
- name: Send Telegram Notification
if: always()
run: |
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" \
-d "parse_mode=Markdown" \
-d "text=🚀 *Gitea Actions Deployment Completed!*%0A*Project:* ${{ gitea.repository }}%0A*Status:* Success"