removed auto deployment
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
name: Deploy Stack to Swarm
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'stacks/**/stack.yml'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Detect changed stacks
|
||||
id: changes
|
||||
run: |
|
||||
if [ "${{ github.event.before }}" = "0000000000000000000000000000000000000000" ]; then
|
||||
echo "⚠️ Initial commit - skipping"
|
||||
echo "changed=" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
CHANGED=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep "stacks/.*/stack.yml$" || true)
|
||||
echo "changed=$CHANGED" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Deploy changed stacks
|
||||
if: steps.changes.outputs.changed != ''
|
||||
run: |
|
||||
for file in ${{ steps.changes.outputs.changed }}; do
|
||||
stack_name=$(basename $(dirname "$file"))
|
||||
echo "🚀 Deploying: $stack_name"
|
||||
docker stack deploy -c "$file" "$stack_name" --with-registry-auth
|
||||
done
|
||||
|
||||
- name: Reload Caddy
|
||||
if: steps.changes.outputs.changed != ''
|
||||
run: |
|
||||
echo "🔄 Restarting Caddy..."
|
||||
docker service update --force caddy_caddy
|
||||
Reference in New Issue
Block a user