Discord webhook ci

This commit is contained in:
Tobias Berger 2021-10-14 14:59:06 +02:00
parent db9dc8f305
commit 12f2ee5161

View file

@ -1,8 +1,7 @@
---
kind: pipeline kind: pipeline
type: docker type: docker
name: test
workspace:
path: /drone/svelte-sharg
# Check if the game builds # Check if the game builds
# If yes, test if everything is nice # If yes, test if everything is nice
@ -46,6 +45,18 @@ steps:
depends_on: depends_on:
- build-game - build-game
- build-pwa - build-pwa
---
kind: pipeline
name: build
depends_on:
- test
workspace:
path: /drone/svelte-sharg
steps:
- name: deploy (production) - name: deploy (production)
image: dockette/vercel image: dockette/vercel
environment: environment:
@ -54,14 +65,10 @@ steps:
VERCEL_SCOPE: VERCEL_SCOPE:
from_secret: VERCEL_SCOPE from_secret: VERCEL_SCOPE
commands: commands:
- vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c --prod - export VERCEL_BUILD_URL=$(vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c --prod)
when: when:
branch: branch:
- main - main
depends_on:
- prettier
- eslint
- type-check
- name: deploy (preview) - name: deploy (preview)
image: dockette/vercel image: dockette/vercel
environment: environment:
@ -70,12 +77,42 @@ steps:
VERCEL_SCOPE: VERCEL_SCOPE:
from_secret: VERCEL_SCOPE from_secret: VERCEL_SCOPE
commands: commands:
- vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c - export VERCEL_BUILD_URL=$(vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c)
when: when:
branch: branch:
exclude: exclude:
- main - main
---
kind: pipeline
name: notify
clone:
disable: true
depends_on: depends_on:
- prettier - build
- eslint
- type-check steps:
- name: sync
image: alpine
- name: discord notification (private)
image: appleboy/drone-discord
settings:
message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{/success}}\n"
webhook_id:
from_secret: discord_webhook_id_private
webhook_token:
from_secret: discord_webhook_token_private
depends_on:
- sync
- name: discord notification (dev server)
image: appleboy/drone-discord
settings:
message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{/success}}\n"
webhook_id:
from_secret: discord_webhook_id_dev_server
webhook_token:
from_secret: discord_webhook_token_dev_server
depends_on:
- sync