diff --git a/.github/workflows/web.yaml b/.github/workflows/web.yaml index fad19ca3..c797a330 100644 --- a/.github/workflows/web.yaml +++ b/.github/workflows/web.yaml @@ -1,4 +1,4 @@ -name: WEB - Deploy to GH Pages +name: WEB - Build Application on: push: @@ -8,12 +8,12 @@ on: jobs: build: - runs-on: ubuntu-latest strategy: matrix: - node-version: [8.x, 10.x, 12.x] + # Don't want to deploy multiple times for multiple versions + node-version: [12.x] steps: - uses: actions/checkout@v2 @@ -29,10 +29,32 @@ jobs: # - run: npm run test:unit # working-directory: ./web # env: - # CI: true - - name: Deploy - uses: JamesIves/github-pages-deploy-action@releases/v3 - with: - SSH: true - BRANCH: gh-pages - FOLDER: dist + # # CI: true + # - name: Deploy + # uses: JamesIves/github-pages-deploy-action@releases/v3 + # with: + # ACCESS_TOKEN: ${{ secrets.timemachineDeploy}} + # BRANCH: gh-pages + # FOLDER: web/dist + + # NOT WORKING BUT SHOULD BE CLOSE? + # - name: Deploy to Dev server + # uses: easingthemes/ssh-deploy@v2.0.7 + # env: + # SSH_PRIVATE_KEY: ${{ secrets.timemachine_dev_ssh_public_key }} + # ARGS: "-rltgoDzvO" + # SOURCE: "dist/" + # REMOTE_HOST: ${{ secrets.timemachine_dev_ip }} + # REMOTE_USER: ${{ secrets.timemachine_dev_user }} + # TARGET: ${{ secrets.timemachine_dev_path }} + # - name: copy file via ssh key + # uses: appleboy/scp-action@master + # env: + # HOST: ${{ secrets.timemachine_dev_ip }} + # USERNAME: ${{ secrets.timemachine_dev_user }} + # PORT: ${{ secrets.PORT }} + # KEY: ${{ secrets.timemachine_dev_ssh_public_key }} + # with: + # source: "dist/*" + # target: "${{ secrets.timemachine_dev_path }}" + diff --git a/.gitignore b/.gitignore index 9f4c740d..64ffbf0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -db/ \ No newline at end of file +db/ +deploy.sh +deploy-api.sh \ No newline at end of file diff --git a/web/.env.local b/web/.env.local index 9212101d..bc9e99a0 100644 --- a/web/.env.local +++ b/web/.env.local @@ -1,2 +1,3 @@ -VUE_APP_API_URI=http://localhost:3000 -VUE_APP_KEYCLOAK_JSON_FILENAME=keycloak-local \ No newline at end of file +VUE_APP_API_URI=http://207.216.46.85:3000 +# TODO - Change this URL above once we have the API setup. Maybe same URL but diff port? +VUE_APP_KEYCLOAK_JSON_FILENAME=statics/keycloak-local \ No newline at end of file diff --git a/web/src/App.vue b/web/src/App.vue index 88f6763a..41399f08 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -73,7 +73,7 @@ -
Time Machine
+
Time Machine - dev
Hi, {{userName}}
diff --git a/web/src/modules/security/init.js b/web/src/modules/security/init.js index 8f3fe8b6..f0bf4bc2 100644 --- a/web/src/modules/security/init.js +++ b/web/src/modules/security/init.js @@ -3,7 +3,8 @@ import Keycloak from 'keycloak-js'; import store from '@/store'; const keycloakFileName = (process.env.VUE_APP_KEYCLOAK_JSON_FILENAME) ? process.env.VUE_APP_KEYCLOAK_JSON_FILENAME : 'keycloak-local'; -const keycloakAuth = new Keycloak(`/statics/${keycloakFileName}.json`); +// const keycloakAuth = new Keycloak(`/statics/${keycloakFileName}.json`); +const keycloakAuth = new Keycloak(`/${keycloakFileName}.json`); const pageBasedOnRole = (role) => { let page = 'Unauthorized'; diff --git a/web/vue.config.js b/web/vue.config.js index ccef3033..03232719 100644 --- a/web/vue.config.js +++ b/web/vue.config.js @@ -2,4 +2,9 @@ module.exports = { configureWebpack: { devtool: 'source-map', }, + + // NOTE - ONLY FOR GitHub Pages! Any way to easily configure, maybe env var + // Using ./ for GH pages - need to verify but turns paths relative + // https://github.com/vuejs/vue-cli/issues/1623 + baseUrl: './' };