diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index ae2e370e7ae..00000000000 --- a/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -# Don't put any files into the docker context, we only need them once the volume is attached -* \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa42e907b4f..04dde17e201 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,46 +14,24 @@ jobs: uses: actions/checkout@v2 with: persist-credentials: false # needed for JamesIves/github-pages-deploy-action - - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.4 - name: Cache Ruby gems id: cache-gems uses: actions/cache@v2 with: path: vendor/bundle key: ${{ runner.os }}-gems-1-${{ hashFiles('Gemfile.lock') }} - - name: Set Ruby gems directory - run: bundle config path vendor/bundle - - name: Install Ruby gems - # if: steps.cache-gems.outputs.cache-hit != 'true' - run: bundle install --jobs 4 --retry 3 --deployment - - - name: Install Node - uses: actions/setup-node@v2 - with: - node-version: '10' # gulp will likely be upset with newer - name: Cache node_modules id: cache-node uses: actions/cache@v2 with: path: node_modules key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install NPM packages - if: steps.cache-node.outputs.cache-hit != 'true' - run: npm install - - name: Cache Bower libraries id: cache-bower uses: actions/cache@v2 with: path: lib key: ${{ runner.os }}-bower-${{ hashFiles('bower.json') }} - - name: Install Bower packages - if: steps.cache-bower.outputs.cache-hit != 'true' - run: node_modules/.bin/bower install - name: Cache SmugMug id: cache-smugmug @@ -67,27 +45,18 @@ jobs: mkdir -p tmp wget https://nthp.s3-eu-west-1.amazonaws.com/sm-cache.tar.xz -O tmp/sm-cache.tar.xz tar xvf tmp/sm-cache.tar.xz + - name: Build + run: ./_bin/install - name: Store build number run: echo -n $(($GITHUB_RUN_NUMBER + 10000)) > _includes/travis_build_number.txt - name: Build the site - run: node_modules/.bin/gulp build_deploy + run: docker-compose exec -T app npm run gulp:deploy env: SMUGMUG_API_KEY: ${{ secrets.SMUGMUG_API_KEY }} SMUGMUG_CACHE_MAINTAIN: true - - name: Cache htmltest files - uses: actions/cache@v2 - with: - path: tmp/htmltest - key: htmltest-1 - - name: Test built site with htmltest - uses: wjdp/htmltest-action@master - continue-on-error: true - with: - skip_external: true - - name: Publish to GH Pages 🚀 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: JamesIves/github-pages-deploy-action@3.7.1 diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 35e70686ba6..00000000000 --- a/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM "ubuntu:bionic" - -### -# This docker file provides a consistant environment for running the -# project locally. See the "Docker" section of README.md for more information -### -SHELL ["/bin/bash", "-c"] - -EXPOSE 8000 - -RUN apt-get update - -RUN apt-get install -y curl sudo gnupg2 build-essential rsync git - -# Install Node -ENV NVM_DIR /usr/local/nvm -ENV NODE_VERSION 8.17.0 - -WORKDIR $NVM_DIR - -RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash \ - && . $NVM_DIR/nvm.sh \ - && nvm install $NODE_VERSION \ - && nvm alias default $NODE_VERSION \ - && nvm use default - -ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules -ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH -# ENV SMUGMUG_API_KEY - -RUN apt-get install -y ruby-dev rubygems libffi-dev -RUN gem install bundler -v 1.17 - -RUN npm install -g gulp coffeescript bower -RUN npm link gulp-v3 --force -RUN npm rebuild node-sass - -# The following is run each time the container is "run" -CMD echo "No command provided, you should be using run_dev.sh" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 09eb59fc94c..274c7251994 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -112,4 +112,4 @@ DEPENDENCIES octokit (~> 4.8.0) BUNDLED WITH - 1.17.3 + 2.1.2 diff --git a/_bin/install b/_bin/install new file mode 100755 index 00000000000..edb68b73bff --- /dev/null +++ b/_bin/install @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +docker-compose down -v +docker-compose build --no-cache +docker-compose up -d --remove-orphans +docker-compose exec -T app bundle install +docker-compose exec -T app npm install +docker-compose exec -T app npm run bower:install +docker-compose exec -T app npm run gulp:build diff --git a/_bin/person_list_generator.py b/_bin/person_list_generator.py old mode 100644 new mode 100755 diff --git a/_bin/serve b/_bin/serve new file mode 100755 index 00000000000..be0d30fd3a3 --- /dev/null +++ b/_bin/serve @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +docker-compose exec app \ + bundle exec jekyll server \ + --host 0.0.0.0 \ + --port 8000 diff --git a/_bin/stub_maker.py b/_bin/stub_maker.py old mode 100644 new mode 100755 diff --git a/_docker/app.dockerfile b/_docker/app.dockerfile new file mode 100644 index 00000000000..70df0d202b4 --- /dev/null +++ b/_docker/app.dockerfile @@ -0,0 +1,25 @@ +ARG RUBY_VERSION=2.4.10 +ARG NODE_VERSION=10.16.0 + +FROM ruby:${RUBY_VERSION} + +WORKDIR /app + +COPY . . + +RUN bundle config path vendor/bundle + +RUN gem install bundler -v 2.3.27 \ + && bundle install + +RUN apt-get -y update \ + && apt-get -y upgrade + +# I hate this. + +RUN apt-get -y install npm + +RUN npm cache clean -f + +RUN npm install -g n \ + && n 10.16.0 \ No newline at end of file diff --git a/assets/for_shows/final-act-2014-soundtrack.zip b/assets/for_shows/final-act-2014-soundtrack.zip deleted file mode 100644 index 4917c17efdb..00000000000 --- a/assets/for_shows/final-act-2014-soundtrack.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:86d41027c507bed909f4cd758873b826bb363211f19a6c58558319e8c2c718f8 -size 82656291 diff --git a/assets/for_shows/mark_shelley_s_frankenstein_script.docx b/assets/for_shows/mark_shelley_s_frankenstein_script.docx deleted file mode 100644 index 7adf1b42207..00000000000 --- a/assets/for_shows/mark_shelley_s_frankenstein_script.docx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:78067a207840ac34587706e476845ff929c84bde5e129918e010a8c67403dfc2 -size 62202 diff --git a/assets/for_shows/wild-west-end-soundtrack.zip b/assets/for_shows/wild-west-end-soundtrack.zip deleted file mode 100644 index 1fbc9737fd3..00000000000 --- a/assets/for_shows/wild-west-end-soundtrack.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3be6e1ce6b928d32d86eacc958852e1b75b2b952b250ab815605b14a23a1fa89 -size 41978903 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000000..c7cd8af5c87 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3' + +services: + app: + platform: linux/x86_64 + build: + context: . + dockerfile: _docker/app.dockerfile + volumes: + - "./:/app" + ports: + - "8000:8000" + networks: + - website-network + entrypoint: tail -f /dev/null + environment: + EXECJS_RUNTIME: Disabled + +networks: + website-network: + driver: bridge + + diff --git a/package.json b/package.json index 2f81c3b6922..f204bac2b7d 100644 --- a/package.json +++ b/package.json @@ -35,5 +35,10 @@ }, "bugs": { "url": "https://github.com/newtheatre/history-project/issues" + }, + "scripts": { + "bower:install": "bower install --allow-root", + "gulp:deploy": "gulp build_deploy", + "gulp:build": "gulp build" } }