-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44b9b36
commit d3c97f3
Showing
8 changed files
with
147 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VUE_APP_BUCKET_URL_PUBLIC_PATH=/ | ||
VUE_APP_HYDROSHARE_URL=https://beta.hydroshare.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Build and Publish to Registry on Github push | ||
|
||
env: | ||
GITHUB_SHA: ${{ github.sha }} | ||
REGISTRY_HOSTNAME: docker.io | ||
REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }} | ||
|
||
on: | ||
- push | ||
- workflow_dispatch | ||
|
||
jobs: | ||
setup-build-publish-deploy: | ||
name: Setup, Build, and Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Prepare | ||
id: prep | ||
run: | | ||
TAG=$(echo $GITHUB_SHA | head -c7) | ||
IMAGE="${REPOSITORY}/hs_discover" | ||
echo ::set-output name=tagged_image::${IMAGE}:${TAG} | ||
echo ::set-output name=tag::${TAG} | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker Hub Login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-single-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-single-buildx | ||
- name: Build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.prep.outputs.tagged_image }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy static content to Pages | ||
|
||
on: | ||
push: | ||
tags: 'gh-pages*' | ||
workflow_dispatch: | ||
|
||
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: 'pages' | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
working-directory: '.' | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
cache-dependency-path: '**/package-lock.json' | ||
- name: create env file | ||
run: | | ||
touch .env | ||
echo VITE_APP_API_URL=${{ secrets.VUE_APP_BUCKET_URL_PUBLIC_PATH }} >> .env | ||
echo VITE_APP_FULL_URL=${{ secrets.VUE_APP_HYDROSHARE_URL }} >> .env | ||
cp .env ../.env | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build | ||
run: npm run build | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
# Upload dist repository | ||
path: './dist' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
__pycache__ | ||
static | ||
templates | ||
templates | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM node:14.14.0 as node-build | ||
|
||
# Arg used by the node build for discovery app | ||
# This is the path to the bucket where the static files are stored | ||
# This should be the same as the STATIC_URL in the Django settings | ||
ARG VUE_APP_BUCKET_URL_PUBLIC_PATH | ||
ARG VUE_APP_HYDROSHARE_URL | ||
|
||
ADD . /hydroshare | ||
|
||
WORKDIR /hydroshare/hs_discover | ||
|
||
RUN rm -rf static templates && \ | ||
mkdir static templates && \ | ||
mkdir templates/hs_discover && \ | ||
mkdir static/js && \ | ||
mkdir static/css && \ | ||
npm install && \ | ||
npm run build && \ | ||
mkdir -p static/js && \ | ||
mkdir -p static/css && \ | ||
cp -rp templates/hs_discover/js static/ && \ | ||
cp -rp templates/hs_discover/css static/ && \ | ||
cp -p templates/hs_discover/map.js static/js/ && \ | ||
echo "----------------js--------------------" && \ | ||
ls -l static/js && \ | ||
echo "--------------------------------------" && \ | ||
echo "----------------css-------------------" && \ | ||
ls -l static/css && \ | ||
echo "--------------------------------------" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.