-
Notifications
You must be signed in to change notification settings - Fork 14
44 lines (37 loc) · 1.29 KB
/
main.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
41
42
43
44
name: Release and Deploy
on:
release:
types:
- published # Trigger workflow only when a release is published
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout code
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Step 3: Log in to GitHub Container Registry
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
# Step 4: Build and push Docker image with both versioned and 'latest' tags
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/clashkinginc/clashkingbot:${{ github.event.release.tag_name }}
ghcr.io/clashkinginc/clashkingbot:latest
# Step 5: Trigger Deployment Webhook
- name: Trigger Deployment
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \
"https://coolify.clashk.ing/api/v1/deploy?uuid=p04sos8s0okso0sk08kw0sog&force=false"