Skip to content

Commit 7935bc6

Browse files
committed
Add new deployment trigger to workflow
1 parent 6141b2f commit 7935bc6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/docker-publish.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,19 @@ jobs:
9696
LIBS=\$(ldd build/bin/wiki_service | awk '/=>/ {print \$3}' | grep '^/')
9797
sentry-cli debug-files upload --include-sources \$LIBS
9898
"
99+
100+
deploy:
101+
if: ${{ github.ref_name == 'master' || github.ref_name == 'deploy/staging' }}
102+
name: Deploy to server
103+
runs-on: ubuntu-latest
104+
needs: build
105+
environment: ${{ github.event_name == 'push' && github.ref_name == 'deploy/staging' && 'staging' || 'production' }}
106+
steps:
107+
- name: Trigger deployment
108+
run: |
109+
curl -X 'POST' \
110+
'${{ secrets.DEPLOY_ENDPOINT }}' \
111+
-H 'accept: application/json' \
112+
-H 'Content-Type: application/json' \
113+
-H 'x-api-key: ${{ secrets.DEPLOY_API_KEY }}' \
114+
-d '{ "applicationId": "${{ secrets.DEPLOY_APP_ID }}" }'

0 commit comments

Comments
 (0)