Skip to content

Commit

Permalink
Merge branch 'production'
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrothwell committed Jan 23, 2025
2 parents f294d8e + 25c8f1d commit 95b5313
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 27 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_PUBLICPATH=/zoning-summary-generator/
29 changes: 24 additions & 5 deletions .github/workflows/prod_push_to_s3.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
name: Build and deploy to S3
name: production Build and deploy to S3
on:
push:
branches:
- master
- production
jobs:
build-and-deploy:
runs-on: ubuntu-latest

permissions:
id-token: write
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: npm install, and build
run: |
printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FA_AUTH_TOKEN}" >> ~/.npmrc
npm ci
npm run build
env:
FA_AUTH_TOKEN: ${{ secrets.FA_AUTH_TOKEN }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::922311303087:role/github-actions@dpd-zoning-summary-generator@master
role-to-assume: arn:aws:iam::922311303087:role/github-actions@dpd-zoning-summary-generator@production
aws-region: us-east-1

- name: Deploy static site to S3 bucket
working-directory: ./
run: aws s3 sync ./ s3://dpd-zoning-summary-generator --delete
env:
AWS_S3_BUCKET: dpd-zoning-summary-generator
run: |
aws s3 sync dist s3://$AWS_S3_BUCKET --delete
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# vue-zoning-generator
# Zoning-Generator

This template should help get you started developing with Vue 3 in Vite.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useRouter, useRoute } from 'vue-router';
const router = useRouter();
const route = useRoute();
console.log('route:', route, 'route.params:', route.params);
console.log('route:', route, 'route.params:', route.params, 'import.meta.env.VITE_PUBLICPATH:', import.meta.env.VITE_PUBLICPATH);
</script>
Expand Down
14 changes: 11 additions & 3 deletions src/components/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ const getZoningInfo = (place) => {
var bounds = drawPoly.getBounds()
map.flyToBounds(bounds);
console.log('router 3:', router);
router.push({ name: 'address', params: { address: addy } });
router.push({ name: 'address', query: { address: addy } });
}
});
var mydata = zoningCodeRules; // identifies the zoning code rules in baseDistricts.json
Expand Down Expand Up @@ -1181,22 +1181,30 @@ onMounted(() => {
document.getElementById("btnSearch").addEventListener("click", addr_search);
console.log('router:', router, 'route.params:', route);
console.log('router:', router, 'route.params:', route.params);
// if (route.params.address) {
// console.log('route.params.address:', route.params.address);
// document.getElementById("addr").value = route.params.address;
// addr_search();
// }
});
watch(() => route.params.address, (address) => {
watch(() => route.query.address, (address) => {
console.log('route.params.address:', address);
if (address) {
// document.getElementById("addr").value = address;
addr_search(address, map);
}
});
// watch(() => route.params.address, (address) => {
// console.log('route.params.address:', address);
// if (address) {
// // document.getElementById("addr").value = address;
// addr_search(address, map);
// }
// });
</script>

<style>
Expand Down
3 changes: 2 additions & 1 deletion src/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ $(function (router) {
drawPoly = L.geoJSON(polygon).addTo(map);
var bounds = drawPoly.getBounds()
map.flyToBounds(bounds);
router.push({ name: 'address', params: { address: addy } });
router.push({ name: 'address', query: { address: addy } });
// router.push({ name: 'address', params: { address: addy } });
}
});
var mydata = zoningCodeRules; // identifies the zoning code rules in baseDistricts.json
Expand Down
9 changes: 4 additions & 5 deletions src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { createRouter, createWebHistory } from 'vue-router'
import App from '@/App.vue';


const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
history: createWebHistory(import.meta.env.PUBLIC_PATH),
// history: createWebHistory(),
routes: [
{
path: '/',
path: import.meta.env.VITE_PUBLICPATH,
name: 'home',
component: App,
},
{
path: '/:address',
path: import.meta.env.VITE_PUBLICPATH,
name: 'address',
component: App,
},
Expand All @@ -20,7 +20,6 @@ const router = createRouter({

router.afterEach((to, from) => {
console.log('router.afterEach to:', to, 'from:', from);

})

export default router
23 changes: 14 additions & 9 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());

return {
plugins: [
vue(),
vueDevTools(),
],
base: env.VITE_PUBLICPATH,
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
}
})

0 comments on commit 95b5313

Please sign in to comment.