v1.1.1 #337
Workflow file for this run
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: 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" |