From fb2b5cfa52108edf112a0ca369bfaac2bcfa2834 Mon Sep 17 00:00:00 2001
From: Hamcha
Date: Tue, 10 May 2022 16:48:02 +0200
Subject: [PATCH] Moved to github!
---
.drone.yml | 127 ----------------------------------
.github/workflows/publish.yml | 32 +++++++++
index.html | 4 +-
package.json | 4 +-
4 files changed, 35 insertions(+), 132 deletions(-)
delete mode 100644 .drone.yml
create mode 100644 .github/workflows/publish.yml
diff --git a/.drone.yml b/.drone.yml
deleted file mode 100644
index dc5a172..0000000
--- a/.drone.yml
+++ /dev/null
@@ -1,127 +0,0 @@
----
-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:
- - npm ci
- depends_on:
- - restore-cache
-
- - name: lint
- image: node
- commands:
- - npm run lint
- depends_on:
- - dependencies
-
- - name: build
- image: node
- commands:
- - npm run build
- environment:
- VITE_SUBPATH: /tghandbook/${DRONE_COMMIT_BRANCH/\//_}-${DRONE_COMMIT_SHA:0:8}
- VITE_APP_REVISION: ${DRONE_COMMIT_SHA}
- when:
- event:
- include:
- - push
- - pull_request
- 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_BRANCH/\//_}-${DRONE_COMMIT_SHA:0:8}/
- strip_prefix: dist/
- path_style: true
- endpoint: https://artifacts.fromouter.space
- when:
- event:
- - push
- depends_on:
- - build
-
- - 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}/
- strip_prefix: dist/
- path_style: true
- endpoint: https://artifacts.fromouter.space
- when:
- event:
- - pull_request
- depends_on:
- - build
-
- - name: upload_build_branch
- image: plugins/s3
- settings:
- bucket: tghandbook
- access_key:
- from_secret: minio_access
- secret_key:
- from_secret: minio_secret
- source: dist/**/*
- target: /${DRONE_COMMIT_BRANCH/\//_}/
- strip_prefix: dist/
- path_style: true
- endpoint: https://artifacts.fromouter.space
- when:
- event:
- - push
- depends_on:
- - build
-
- - 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
-
-trigger:
- event:
- - push
- - pull_request
----
-kind: signature
-hmac: 80f0ae9213a4857606e7a6f2e64b9f1f47f1b80186f9ecd5b7aada7481a75db4
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..e3aa2ba
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,32 @@
+name: Publish on GitHub Pages
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+
+jobs:
+ deploy:
+ runs-on: ubuntu-20.04
+ concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Install Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+
+ - name: Install dependencies
+ run: npm ci
+ - run: npm lint
+ - run: npm run build --if-present
+
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v3
+ if: ${{ github.ref == 'refs/heads/main' }}
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./dist
diff --git a/index.html b/index.html
index 079e898..3b5a48d 100644
--- a/index.html
+++ b/index.html
@@ -127,8 +127,8 @@
This thing is Open Source:
- git.fromouter.space/hamcha/tghandbookgithub.com/Hamcha/tghandbook
diff --git a/package.json b/package.json
index ae44587..79b7101 100644
--- a/package.json
+++ b/package.json
@@ -7,9 +7,7 @@
"scripts": {
"start": "vite",
"lint": "eslint src",
- "build": "vite build --base=./",
- "build-branch": "vite build --base=./ --outDir=dist-branch",
- "build-pr": "vite build --base=./ --outDir=dist-pr"
+ "build": "vite build --base=./"
},
"dependencies": {
"@types/node": "^17.0.31",