Skip to content

Commit

Permalink
Merge branch 'main' of github.com:leaphy-robotics/leaphy-webbased-svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
sverben committed May 3, 2024
2 parents 0f86a15 + 9e592d3 commit 5a16e66
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules/
dist/
.git/
.env*
.github/
14 changes: 13 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create TEST env file
if: github.ref_type == 'branch'
run: |
cat << EOF > .env
VITE_BACKEND_URL="https://testleaphyeasybloqs.com:8443"
VITE_MATOMO_URL="https://leaphyeasybloqs.com/matomo/"
VITE_MATOMO_SITE_ID="2"
VITE_BACKEND_URL="https://webservice.leaphyeasybloqs.com"
VITE_SENTRY_DSN="${{ secrets.VITE_SENTRY_DSN }}"
VITE_SENTRY_SAMPLE_RATE="1.0"
EOF
- name: Build and push TEST Docker image
if: github.ref_type == 'branch'
uses: docker/build-push-action@v5
Expand All @@ -34,7 +46,7 @@ jobs:
- name: Redeploy TEST
if: github.ref_type == 'branch'
run: |
curl https://admin.leaphyeasybloqs.com/hooks/update-docker-image?stack=leaphy-webbased-svelte -H "X-Token: ${{ secrets.WEBHOOK_TOKEN }}"
curl https://admin.leaphyeasybloqs.com/hooks/update-docker-image?stack=leaphy-webbased-test -H "X-Token: ${{ secrets.WEBHOOK_TOKEN }}"
- name: Clean up old images
uses: actions/delete-package-versions@v5
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ jobs:
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
cache: yarn
- name: Install node modules
run: yarn --frozen-lockfile --prefer-offline
- name: Run Biome
run: yarn biome check src tests
run: yarn biome ci src tests
- name: Run Playwright tests
run: yarn playwright test
- uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/core/header/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import Warning from "../popups/popups/Warning.svelte";
import { FileHandle } from "$domain/handles";
async function upload() {
window._paq.push(["trackEvent", "Main", "UploadClicked"]);
popups.open({
component: Uploader,
data: {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/components/start/RobotSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ interface Props {
const { robots, secondary }: Props = $props();
function select(type: Robot) {
window._paq.push(["trackEvent", "SelectRobot", type.name]);
if ("variants" in type) return selected.set(type);
if ("mode" in type) {
code.set(type.defaultProgram);
Expand Down
3 changes: 2 additions & 1 deletion src/lib/matomo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ declare global {
}

function initMatomo() {
// Always create the _paq array so dev code works
const _paq = (window._paq = window._paq || []);
// Only track prod builds
if (!import.meta.env.PROD) return;

const _paq = (window._paq = window._paq || []);
const u = import.meta.env.VITE_MATOMO_URL;
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
Expand Down
4 changes: 2 additions & 2 deletions tests/blink_example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from "@playwright/test";
import { goToHomePage } from "./utils";
import consumers from "node:stream/consumers";
import { expect, test } from "@playwright/test";
import { goToHomePage } from "./utils";

test.beforeEach(goToHomePage);

Expand Down

0 comments on commit 5a16e66

Please sign in to comment.