forked from buerokratt/Classifier
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.06 KB
/
est-frontend-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Deploy Frontend
on:
push:
branches:
- dev
jobs:
deploy:
runs-on: [self-hosted, est-cls-dev]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Remove all running containers, images, and prune Docker system
run: |
docker stop $(docker ps -a -q) || true
docker rm $(docker ps -a -q) || true
docker rmi $(docker images -q) || true
docker system prune -af
- name: Build and run Docker Compose
run: |
docker compose up --build -d
- name: Get public IP address
id: get_ip
run: |
PUBLIC_IP=$(curl -s http://checkip.amazonaws.com)
echo "PUBLIC_IP=$PUBLIC_IP" >> $GITHUB_ENV
- name: Send Slack notification
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
PUBLIC_IP: ${{ env.PUBLIC_IP }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"Build is complete. Public IP: $PUBLIC_IP\"
}" $SLACK_WEBHOOK_URL