Skip to content

Commit

Permalink
Refactor environment variables in .env.template and Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Oct 2, 2024
1 parent f6a4a78 commit fbe15a5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
VUE_APP_BUCKET_URL_PUBLIC_PATH=/
VUE_APP_HYDROSHARE_URL=http://localhost:8000
VUE_APP_BUCKET_URL_PUBLIC_PATH=/
16 changes: 13 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ env:
REGISTRY_HOSTNAME: docker.io
REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}

on:
- push
- workflow_dispatch
on:
push:
branches:
- main
workflow_dispatch:

defaults:
run:
working-directory: '.'

jobs:
setup-build-publish-deploy:
Expand All @@ -24,6 +30,10 @@ jobs:
IMAGE="${REPOSITORY}/hs_discover"
echo ::set-output name=tagged_image::${IMAGE}:${TAG}
echo ::set-output name=tag::${TAG}
- name: create env file
run: |
touch .env
echo VUE_APP_BUCKET_URL_PUBLIC_PATH=${{ secrets.VUE_APP_BUCKET_URL_PUBLIC_PATH }} >> .env
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ jobs:
run: |
touch .env
echo VUE_APP_BUCKET_URL_PUBLIC_PATH=${{ secrets.VUE_APP_BUCKET_URL_PUBLIC_PATH }} >> .env
echo VUE_APP_HYDROSHARE_URL=${{ secrets.VUE_APP_HYDROSHARE_URL }} >> .env
cp .env ../.env
- name: Install dependencies
run: npm install
- name: Build
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
FROM node:14.14.0 as build-stage

ARG VUE_APP_BUCKET_URL_PUBLIC_PATH
ARG VUE_APP_HYDROSHARE_URL

ADD . /
WORKDIR /
Expand Down
4 changes: 2 additions & 2 deletions src/components/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ export default {
this.typeFilter = [];
this.availabilityFilter = [];
}
// const hydroshareUrl = process.env.VUE_APP_HYDROSHARE_URL;
// axios.get(`${hydroshareUrl}/discoverapi/`, {
// here we assume that this app will be embedded within HS django page
// Otherwise, we need to use the full URL to HydroShare
axios.get('/discoverapi/', {
params: {
q: this.searchtext,
Expand Down

0 comments on commit fbe15a5

Please sign in to comment.