diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..5151fdc --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,63 @@ +name: Deploy static content to Pages + +on: + push: + pull_request: + branches: ['main'] + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: false + +jobs: + check: + runs-on: ubuntu-latest + env: + BASE: /osmfilter/ + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm install --frozen-lockfile + - name: Build project + run: npm run check-all + + deploy: + needs: check + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + env: + BASE: /osmfilter/ + VITE_ROUTER: hash + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm install --frozen-lockfile + - name: Build project + run: npm run build-only + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './dist' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/package.json b/package.json index 794a7e4..dc1aaba 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "type-check": "vue-tsc --build --force", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", "format": "prettier --write src/", - "check": "prettier --check src/" + "check": "prettier --check src/", + "check-all": "run-p check type-check lint --" }, "dependencies": { "@vuestic/tailwind": "^0.1.5", diff --git a/src/router/index.ts b/src/router/index.ts index e670040..c68e95e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,8 +1,15 @@ -import { createRouter, createWebHistory } from 'vue-router'; +import { + createRouter, + createWebHashHistory, + createWebHistory +} from 'vue-router'; import HomeView from '../views/HomeView.vue'; const router = createRouter({ - history: createWebHistory(import.meta.env.BASE_URL), + history: + import.meta.env.VITE_ROUTER === 'hash' + ? createWebHashHistory(import.meta.env.BASE_URL) + : createWebHistory(import.meta.env.BASE_URL), routes: [ { path: '/', diff --git a/src/views/FilterView.vue b/src/views/FilterView.vue index 1f854b7..5f07189 100644 --- a/src/views/FilterView.vue +++ b/src/views/FilterView.vue @@ -1,12 +1,9 @@