diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..55a6d0a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,142 @@ +kind: pipeline +name: default + +steps: + - name: restore-cache + image: drillster/drone-volume-cache + volumes: + - name: cache + path: /cache + settings: + restore: true + mount: + - ./node_modules + + - name: dependencies + image: node + failure: ignore + commands: + - yarn + depends_on: + - restore-cache + + - name: lint + image: node + commands: + - yarn lint + depends_on: + - dependencies + + - name: build_versioned + image: node + commands: + - yarn build + when: + event: + - push + branch: + exclude: + - master + depends_on: + - dependencies + + - name: build_pr + image: node + commands: + - yarn build + when: + event: + - pull_request + depends_on: + - dependencies + + - name: build_master + image: node + commands: + - yarn build + environment: + SUBPATH: /latest + when: + event: + - push + branch: + - master + depends_on: + - dependencies + + - name: upload_build_versioned + image: plugins/s3 + settings: + bucket: tghandbook + access_key: + from_secret: minio_access + secret_key: + from_secret: minio_secret + source: dist/**/* + target: /${DRONE_COMMIT_SHA:0:8}/ + path_style: true + endpoint: https://artifacts.fromouter.space + when: + event: + - push + branch: + exclude: + - master + depends_on: + - build_versioned + + - name: upload_build_pr + image: plugins/s3 + settings: + bucket: tghandbook + access_key: + from_secret: minio_access + secret_key: + from_secret: minio_secret + source: dist/**/* + target: /pr-${DRONE_PULL_REQUEST}/ + path_style: true + endpoint: https://artifacts.fromouter.space + when: + event: + - pull_request + depends_on: + - build_pr + + - name: upload_build_master + image: plugins/s3 + settings: + bucket: tghandbook + access_key: + from_secret: minio_access + secret_key: + from_secret: minio_secret + source: dist/**/* + target: /latest/ + path_style: true + endpoint: https://artifacts.fromouter.space + when: + event: + - push + branch: + - master + depends_on: + - build_master + + - name: rebuild-cache + image: drillster/drone-volume-cache + failure: ignore + volumes: + - name: cache + path: /cache + settings: + rebuild: true + mount: + - ./node_modules + depends_on: + - dependencies + +volumes: + - name: cache + host: + path: /opt/gitea/drone-cache/hamcha/tghandbook diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..2f90cce --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,29 @@ +module.exports = { + env: { + browser: true, + es2020: true, + }, + extends: [ + "airbnb-base", + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended", + ], + parser: "@typescript-eslint/parser", + plugins: ["@typescript-eslint", "prettier"], + rules: { + "prettier/prettier": "error", + "one-var": "off", // WHO CARES????? + "no-use-before-define": "off", // YOU ARE WRONG + "import/extensions": "off", + "import/no-unresolved": "off", + "no-param-reassign": "off", + "no-alert": "off", + "no-console": "off", + "@typescript-eslint/ban-ts-comment": [ + "error", + { + "ts-expect-error": "allow-with-description", + }, + ], + }, +}; diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..feda119 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": false, + "endOfLine": "auto" +} diff --git a/README.md b/README.md index 65d6bca..37d78e2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # /tg/ handbook +[![Build Status](https://drone.zyg.ovh/api/badges/Hamcha/tghandbook/status.svg)](https://drone.zyg.ovh/Hamcha/tghandbook) + ## Building `yarn build` diff --git a/index.html b/index.html index 5ad554f..6bbca35 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,25 @@
- + + + + + +