diff --git a/.env.template b/.env.template index 04fbd8a..b9bc3f8 100644 --- a/.env.template +++ b/.env.template @@ -1,2 +1 @@ -VUE_APP_BUCKET_URL_PUBLIC_PATH=/ -VUE_APP_HYDROSHARE_URL=http://localhost:8000 \ No newline at end of file +VUE_APP_BUCKET_URL_PUBLIC_PATH=/ \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d64d4f5..3e15d0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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 diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 7f99f19..7053459 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index b6c8459..e5bec7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 / diff --git a/src/components/Search.vue b/src/components/Search.vue index 230c595..c153975 100644 --- a/src/components/Search.vue +++ b/src/components/Search.vue @@ -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,