-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 1.1 KB
/
deploy.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
name: Auto-deploy
on:
push:
branches:
- master
jobs:
launch_commands:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
#- name: Install cURL
# run: sudo apt-get update && sudo apt-get install -y curl
- name: Login to Semaphore
env:
ANSIBLE_PASSWORD: ${{ secrets.ANSIBLE_PASSWORD }}
run: |
response=$(curl -X POST -d "{\"auth\": \"ci\", \"password\": \"$ANSIBLE_PASSWORD\"}" -c cookies.txt -w "%{http_code}" -o /dev/null https://semaphore.mubelotix.xyz/api/auth/login)
if [ "$response" -lt 200 ] || [ "$response" -ge 300 ]; then
echo "Login to Semaphore failed with status code $response"
exit 1
fi
- name: Launch Task on Semaphore
run: |
response=$(curl -X POST -b cookies.txt -d '{"template_id": 34}' -w "%{http_code}" -o /dev/null https://semaphore.mubelotix.xyz/api/project/2/tasks)
if [ "$response" -lt 200 ] || [ "$response" -ge 300 ]; then
echo "Launching Task on Semaphore failed with status code $response"
exit 1
fi