forked from mgckind/des_ncsa
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First attempt to build GitHub Pages site
- Loading branch information
1 parent
8f250f3
commit 84e72eb
Showing
19 changed files
with
211 additions
and
894 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,89 @@ | ||
name: build-pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'github-pages' | ||
paths: | ||
- '**' | ||
- '.github/workflows/build-pages.yaml' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- | ||
name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- | ||
name: Login to container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: "hub.ncsa.illinois.edu" | ||
username: "${{ secrets.NCSA_HARBOR_DES_PUBLIC_USERNAME }}" | ||
password: "${{ secrets.NCSA_HARBOR_DES_PUBLIC_TOKEN }}" | ||
- | ||
name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: hub.ncsa.illinois.edu/des-public/desdm-public:pages | ||
# From https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
- | ||
# Temp fix | ||
# https://github.com/docker/build-push-action/issues/252 | ||
# https://github.com/moby/buildkit/issues/1896 | ||
name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
- | ||
name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} | ||
|
||
- | ||
uses: shrink/actions-docker-extract@v3 | ||
id: extract | ||
with: | ||
image: hub.ncsa.illinois.edu/des-public/desdm-public:pages | ||
path: /srv/jekyll/. | ||
- | ||
name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: ${{ steps.extract.outputs.destination }} | ||
name: dist | ||
|
||
# Deployment job | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
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,8 +1,17 @@ | ||
*.pyc | ||
static/files/SVA1/* | ||
static/log.csv | ||
__pycache__/ | ||
static/bower_components/* | ||
.DS_Store | ||
.codesync | ||
static/des_components/elements-built.html | ||
|
||
# Jekyll | ||
|
||
# Gemfile | ||
*.gem | ||
.jekyll-cache | ||
.bundle | ||
.sass-cache | ||
_site | ||
Gemfile.lock | ||
.idea |
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,29 +1,46 @@ | ||
FROM ubuntu:20.04 | ||
FROM node:20 as build | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
python3-pip \ | ||
wget \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# RUN apt-get update && \ | ||
# apt-get install -y \ | ||
# python3-pip \ | ||
# wget \ | ||
# && rm -rf /var/lib/apt/lists/* | ||
|
||
# Basic python reqs | ||
RUN pip3 install --no-cache-dir jira | ||
RUN pip3 install --no-cache-dir netaddr | ||
RUN pip3 install --no-cache-dir bcrypt | ||
RUN pip3 install --no-cache-dir pyyaml | ||
RUN pip3 install --no-cache-dir tornado==5.0.1 | ||
RUN pip3 install --no-cache-dir jsmin | ||
# RUN pip3 install --no-cache-dir jira | ||
# RUN pip3 install --no-cache-dir netaddr | ||
# RUN pip3 install --no-cache-dir bcrypt | ||
# RUN pip3 install --no-cache-dir pyyaml | ||
# RUN pip3 install --no-cache-dir tornado==5.0.1 | ||
# RUN pip install --no-cache-dir jsmin | ||
|
||
WORKDIR /opt | ||
RUN wget https://nodejs.org/dist/v12.14.1/node-v12.14.1-linux-x64.tar.xz | ||
RUN tar -C /usr/local --strip-components 1 -xf /opt/node-v12.14.1-linux-x64.tar.xz | ||
# WORKDIR /tmp | ||
# ADD https://nodejs.org/dist/v12.14.1/node-v12.14.1-linux-x64.tar.xz | ||
# RUN tar -C /usr/local --strip-components 1 -xf /tmp/node-v12.14.1-linux-x64.tar.xz | ||
RUN npm install -g [email protected] | ||
|
||
RUN useradd --create-home --shell /bin/bash des --uid 1001 | ||
USER des | ||
WORKDIR /home/des/ | ||
# RUN useradd --create-home --shell /bin/bash des --uid 1001 | ||
# USER des | ||
WORKDIR /opt | ||
COPY --chown=des:des ./ ./ | ||
|
||
RUN python3 vulcan.py --build | ||
RUN vulcanize static/des_components/elements.html \ | ||
--exclude static/bower_components/polymer/lib/legacy/ \ | ||
--out-html static/des_components/elements-built.html | ||
|
||
FROM jekyll/jekyll:3.8 | ||
## Currently jekyll/jekyll:4 fails with the error below so tag 3.8 is used instead. | ||
|
||
ENV JEKYLL_UID=1000 | ||
ENV JEKYLL_GID=1000 | ||
|
||
USER ${JEKYLL_UID} | ||
|
||
## Install required gems | ||
COPY ./Gemfile ./Gemfile | ||
RUN bundle install | ||
|
||
## Copy source files | ||
COPY --from=build --chown=${JEKYLL_UID}:${JEKYLL_GID} /opt/ ./ | ||
|
||
CMD [ "python3", "main.py" ] | ||
CMD ["bundle", "exec", "jekyll", "serve", "--host=0.0.0.0", "--watch", "--drafts"] |
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,10 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "github-pages", '228', group: :jekyll_plugins | ||
|
||
# enable tzinfo-data for local build | ||
# gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw] | ||
# gem 'jekyll-paginate', '1.1.0' | ||
# gem 'faraday', '2.7.4' | ||
# gem 'faraday-retry', '2.0.0' | ||
# gem 'webrick', '1.8.1' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.