From c97a525f249241fbfa778a57f227af3d624d3019 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 24 Jan 2025 19:54:27 +0100 Subject: [PATCH] chore: github workflows setup --- .firebaserc | 5 +++++ .github/workflows/firebase-hosting-merge.yml | 20 ++++++++++++++++++ .../firebase-hosting-pull-request.yml | 21 +++++++++++++++++++ firebase.json | 10 +++++++++ src/App.vue | 21 +++++++------------ 5 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 .firebaserc create mode 100644 .github/workflows/firebase-hosting-merge.yml create mode 100644 .github/workflows/firebase-hosting-pull-request.yml create mode 100644 firebase.json diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 0000000..e10520b --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "srjp-td2" + } +} diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 0000000..24d23c4 --- /dev/null +++ b/.github/workflows/firebase-hosting-merge.yml @@ -0,0 +1,20 @@ +# This file was auto-generated by the Firebase CLI +# https://github.com/firebase/firebase-tools + +name: Deploy to Firebase Hosting on merge +on: + push: + branches: + - main +jobs: + build_and_deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: yarn build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: ${{ secrets.GITHUB_TOKEN }} + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SRJP_TD2 }} + channelId: live + projectId: srjp-td2 diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 0000000..1540d1f --- /dev/null +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -0,0 +1,21 @@ +# This file was auto-generated by the Firebase CLI +# https://github.com/firebase/firebase-tools + +name: Deploy to Firebase Hosting on PR +on: pull_request +permissions: + checks: write + contents: read + pull-requests: write +jobs: + build_and_preview: + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: yarn build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: ${{ secrets.GITHUB_TOKEN }} + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SRJP_TD2 }} + projectId: srjp-td2 diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..059fe4f --- /dev/null +++ b/firebase.json @@ -0,0 +1,10 @@ +{ + "hosting": { + "public": "dist", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] + } +} diff --git a/src/App.vue b/src/App.vue index f3ab828..f4a99ca 100644 --- a/src/App.vue +++ b/src/App.vue @@ -209,14 +209,14 @@ import { defineComponent } from 'vue'; import { useGlobalStore } from './stores/global.store'; -const additionalData = { - // Mijanki - passings: ['Stolnica Wielka'], - // SHP - shpSystems: [], - // 4-stawne SBL - sbl4: [], -}; +// const additionalData = { +// // Mijanki +// passings: ['Stolnica Wielka'], +// // SHP +// shpSystems: [], +// // 4-stawne SBL +// sbl4: [], +// }; interface StopRow { pointName: string; @@ -301,8 +301,6 @@ export default defineComponent({ let departureSpeed = currentPath.departureLineData?.routeSpeed ?? 0, departureTracks = currentPath.departureLineData?.routeTracks ?? 2; - let checkEntryAsFirst = true; - for (const stop of timetable.stopList) { if (stop.arrivalLine && stop.arrivalLine == currentPath.arrivalLine) { arrivalKm = stop.stopDistance; @@ -339,8 +337,6 @@ export default defineComponent({ }; arrivalKm = stop.stopDistance; - checkEntryAsFirst = false; - if (stop.departureTimestamp) lastDepartureTimestamp = stop.departureTimestamp; stopRows.push(rowData); @@ -361,7 +357,6 @@ export default defineComponent({ } currentPath = timetablePath[++currentPathIndex]; - checkEntryAsFirst = true; } }