Skip to content

Commit

Permalink
try to autodeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Geczy committed Dec 20, 2023
1 parent 8bc586f commit 3f074d0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# context: .
# push: true
# target: main
# tags: ghcr.io/<name>/<image-name>:latest
# cache-from: type=registry,ref=ghcr.io/<name>/<image-name>:latest
# cache-to: type=inline
- name: Build the Docker image
run: |
docker compose -f ./docker-compose.yml build
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Map and Notify On Registry Package Update

on:
registry_package:
types: [updated]

jobs:
notify:
runs-on: ubuntu-latest

steps:
- name: Check for image tag information and valid package name
if: |
github.event.registry_package.package_version.container_metadata.tag.name != '' &&
(
github.event.registry_package.name == 'dota' ||
github.event.registry_package.name == 'twitch-events' ||
github.event.registry_package.name == 'twitch-chat' ||
github.event.registry_package.name == 'steam'
)
run: |
# Map package name to UUID
case "${{ github.event.registry_package.name }}" in
"dota") UUID="esgckgc" ;;
"twitch-events") UUID="aopskdk" ;;
"twitch-chat") UUID="gahgag" ;;
"steam") UUID="asldja" ;;
esac
# Use curl to call a GET webhook with the mapped UUID and API key from secrets
curl -X GET -H "Authorization: Bearer ${{ secrets.COOLIFY_API_KEY }}" "https://${{ secrets.COOLIFY_HOST }}/api/v1/deploy?uuid=${UUID}&force=false"

0 comments on commit 3f074d0

Please sign in to comment.