Skip to content

Commit

Permalink
CI/CD tasks and initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
acoard committed Feb 12, 2020
1 parent c04e88d commit 726df04
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 15 deletions.
42 changes: 32 additions & 10 deletions .github/workflows/web.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: WEB - Deploy to GH Pages
name: WEB - Build Application

on:
push:
Expand All @@ -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
Expand All @@ -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/[email protected]
# 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 }}"

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
db/
db/
deploy.sh
deploy-api.sh
5 changes: 3 additions & 2 deletions web/.env.local
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VUE_APP_API_URI=http://localhost:3000
VUE_APP_KEYCLOAK_JSON_FILENAME=keycloak-local
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
2 changes: 1 addition & 1 deletion web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<v-toolbar-title class="App-toolbar-title">
<img src="./images/logo.svg" alt="avatar" class="app-logo"/>
</v-toolbar-title>
<div class="app-title">Time Machine</div>
<div class="app-title">Time Machine - dev</div>
<v-spacer></v-spacer>
<div class="user-name" v-if="userName">Hi, {{userName}}</div>
</v-toolbar>
Expand Down
3 changes: 2 additions & 1 deletion web/src/modules/security/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
5 changes: 5 additions & 0 deletions web/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: './'
};

0 comments on commit 726df04

Please sign in to comment.