Skip to content

Commit

Permalink
Merge pull request #62 from CityOfPhiladelphia/vue3-pinboard
Browse files Browse the repository at this point in the history
Vue3 pinboard
  • Loading branch information
ajrothwell authored Jan 17, 2025
2 parents a9e4697 + 8b59bdb commit a422d17
Show file tree
Hide file tree
Showing 35 changed files with 6,758 additions and 18,150 deletions.
3 changes: 2 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VUE_APP_PUBLICPATH=/dev/ballot-drop-off/
VITE_PUBLICPATH=/dev/ballot-drop-off/
VITE_DEBUG=false
1 change: 0 additions & 1 deletion .env.development2

This file was deleted.

1 change: 0 additions & 1 deletion .env.development3

This file was deleted.

3 changes: 2 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VUE_APP_PUBLICPATH=/ballot-drop-off/
VITE_PUBLICPATH=/ballot-drop-off/
VITE_DEBUG=false
2 changes: 2 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_PUBLICPATH=/testing/ballot-drop-off/
VITE_DEBUG=true
43 changes: 0 additions & 43 deletions .eslintrc.js

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/dev2_push_to_s3.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/dev3_push_to_s3.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/dev_cache_and_push_to_s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Development caching with npm and push

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list

- name: Install dependencies
run: |
printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}" >> ~/.npmrc
npm ci
npm list
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FA_AUTH_TOKEN }}

- name: Build for development
run: npm run build:development

- name: Deploy to Dev s3, Set index headers
env:
AWS_DEFAULT_REGION: 'us-east-1'
AWS_S3_BUCKET: phila-resource-finder-v2/dev/ballot-drop-off/
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 sync dist s3://$AWS_S3_BUCKET --region us-east-1 --delete
aws s3 cp s3://$AWS_S3_BUCKET s3://$AWS_S3_BUCKET --recursive --exclude "*" --include "*.html" --metadata-directive REPLACE --acl public-read --cache-control max-age=0,no-cache,no-store,must-revalidate,proxy-revalidate,public --expires "0" --content-type "text/html; charset=utf-8"
46 changes: 0 additions & 46 deletions .github/workflows/dev_push_to_s3.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/prod_cache_and_push_to_s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Production caching with npm and push

on:
push:
branches:
- production

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list

- name: Install dependencies
run: |
printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}" >> ~/.npmrc
npm ci
npm list
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FA_AUTH_TOKEN }}

- name: Build for production
run: npm run build:production

- name: Deploy to Production s3, Set index headers
env:
AWS_DEFAULT_REGION: 'us-east-1'
AWS_S3_BUCKET: prod-philavotes/ballot-drop-off
AWS_ACCESS_KEY_ID: ${{ secrets.PHILAVOTES_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PHILAVOTES_AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 sync dist s3://$AWS_S3_BUCKET --region us-east-1 --delete
aws s3 cp s3://$AWS_S3_BUCKET s3://$AWS_S3_BUCKET --recursive --exclude "*" --include "*.html" --metadata-directive REPLACE --acl public-read --cache-control max-age=0,no-cache,no-store,must-revalidate,proxy-revalidate,public --expires "0" --content-type "text/html; charset=utf-8"
47 changes: 0 additions & 47 deletions .github/workflows/prod_push_to_s3.yml

This file was deleted.

Loading

0 comments on commit a422d17

Please sign in to comment.