fix jwt (#9) #4
This file contains hidden or 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: Docker Push | |
on: | |
push: | |
# Publish `main` as Docker `latest` image. | |
branches: | |
- main | |
# Publish `v1.2.3` tags as releases. | |
tags: | |
- v* | |
env: | |
IMAGE_NAME: kite | |
jobs: | |
# Push image to GitHub Packages. | |
# See also https://docs.docker.com/docker-hub/builds/ | |
push: | |
runs-on: ubuntu-latest | |
if: ${{ github.repository_owner == 'zxh326' }} | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.ref_name == 'main' && 'latest' || github.ref_name }} | |
labels: runnumber=${{ github.run_id }} | |
- name: Notify webhook | |
continue-on-error: true | |
env: | |
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} | |
WEBHOOK_PASSWORD: ${{ secrets.WEBHOOK_PASSWORD }} | |
run: | | |
if [ -n "$WEBHOOK_URL" ]; then | |
curl -X POST "$WEBHOOK_URL/api/v1/webhooks/events" \ | |
-H "Content-Type: application/json" \ | |
-u "kite-webhook:$WEBHOOK_PASSWORD" \ | |
-d '{ | |
"action": "restart", | |
"resource": "deployments", | |
"name": "kite", | |
"namespace": "default" | |
}' | |
else | |
echo "WEBHOOK_URL not configured, skipping webhook notification" | |
fi |