Skip to content

Commit

Permalink
Add continuous delivery to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDrike committed Sep 6, 2024
1 parent 2d81a23 commit 2433048
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-publish:
docker:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -78,3 +79,20 @@ jobs:
ghcr.io/itsdrike/web:${{ steps.sha_tag.outputs.tag }}
build-args: |
git_sha=${{ github.sha }}
deploy-portainer:
runs-on: ubuntu-latest
needs: [docker]
env:
WEBHOOK: ${{ secrets.PORTAINER_WEBHOOK }}
if: (github.event_name == 'push' || github.event == 'workflow_dispatch') && github.ref == 'refs/heads/main'

steps:
- name: Trigger Portainer Webhook
if: env.WEBHOOK != ''
run: |
response=$(curl -s -X POST -o /dev/null -w "%{http_code}" ${{ secrets.PORTAINER_WEBHOOK }})
if [[ "$response" -lt 200 || "$response" -ge 300 ]]; then
echo "Webhook trigger failed with response code $response"
exit 1
fi

0 comments on commit 2433048

Please sign in to comment.