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