From 12f2ee5161411c4df29692f784de54d4bc9e62f8 Mon Sep 17 00:00:00 2001 From: Tobias Berger Date: Thu, 14 Oct 2021 14:59:06 +0200 Subject: [PATCH] Discord webhook ci --- .drone.yml | 63 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index ba08dac..8dfbdad 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,8 +1,7 @@ +--- kind: pipeline type: docker - -workspace: - path: /drone/svelte-sharg +name: test # Check if the game builds # If yes, test if everything is nice @@ -46,6 +45,18 @@ steps: depends_on: - build-game - build-pwa + +--- +kind: pipeline +name: build + +depends_on: + - test + +workspace: + path: /drone/svelte-sharg + +steps: - name: deploy (production) image: dockette/vercel environment: @@ -54,14 +65,10 @@ steps: VERCEL_SCOPE: from_secret: VERCEL_SCOPE commands: - - vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c --prod + - export VERCEL_BUILD_URL=$(vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c --prod) when: branch: - main - depends_on: - - prettier - - eslint - - type-check - name: deploy (preview) image: dockette/vercel environment: @@ -70,12 +77,42 @@ steps: VERCEL_SCOPE: from_secret: VERCEL_SCOPE commands: - - vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c + - export VERCEL_BUILD_URL=$(vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c) when: branch: exclude: - main - depends_on: - - prettier - - eslint - - type-check + +--- +kind: pipeline +name: notify + +clone: + disable: true + +depends_on: + - build + +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