This repository has been archived on 2021-11-08. You can view files and clone it, but cannot push or open issues or pull requests.
svelte-sharg/.drone.yml
2021-10-14 17:30:35 +02:00

118 lines
3 KiB
YAML

---
kind: pipeline
type: docker
name: test
# Check if the game builds
# If yes, test if everything is nice
# If yes, deploy to vercel
steps:
- name: install
image: node
commands:
- yarn
- name: build-game
image: node
commands:
- yarn build:game
depends_on:
- install
- name: build-pwa
image: node
commands:
- yarn build:pwa
depends_on:
- install
- name: prettier
image: node
commands:
- yarn lint:prettier:all
depends_on:
- build-game
- build-pwa
- name: eslint
image: node
commands:
- yarn lint:eslint --max-warnings=0
depends_on:
- build-game
- build-pwa
- name: type-check
image: node
commands:
- yarn type-check
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:
VERCEL_TOKEN:
from_secret: VERCEL_TOKEN
VERCEL_SCOPE:
from_secret: VERCEL_SCOPE
commands:
- export VERCEL_BUILD_URL=$(vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c --prod)
when:
branch:
- main
- name: deploy (preview)
image: dockette/vercel
environment:
VERCEL_TOKEN:
from_secret: VERCEL_TOKEN
VERCEL_SCOPE:
from_secret: VERCEL_SCOPE
commands:
- export VERCEL_BUILD_URL=$(vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c)
when:
branch:
exclude:
- main
---
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