Browse Source

remove docker stuff (it doesn't play nice with webpack/gulp/etc.)

pull/441/head
Jake Jarvis 4 months ago
parent
commit
fde728bf22
Signed by: jake GPG Key ID: 2B0C9CF251E69A39
  1. 2
      .env.example
  2. 15
      .github/workflows/ci.yml
  3. 6
      .github/workflows/post-deploy.yml
  4. 13
      Dockerfile
  5. 12
      README.md
  6. 3
      package.json
  7. 10
      webpack.config.js
  8. 11
      yarn.lock

2
.env.example

@ -10,3 +10,5 @@ LHCI_SERVER_BASE_URL=
LHCI_TOKEN=
LHCI_ADMIN_TOKEN=
LHCI_GITHUB_APP_TOKEN=
SENTRY_AUTH_TOKEN=
SENTRY_DSN=

15
.github/workflows/ci.yml

@ -17,10 +17,8 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run linters
run: yarn lint
- run: yarn install --frozen-lockfile
- run: yarn lint
snapshot:
runs-on: ubuntu-latest
@ -32,11 +30,8 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build site
run: yarn build
- name: Percy snapshots
uses: percy/snapshot-action@v0.1.2
- run: yarn install --frozen-lockfile
- run: yarn build
- uses: percy/snapshot-action@v0.1.2
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

6
.github/workflows/post-deploy.yml

@ -15,6 +15,9 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 14.x
- uses: getsentry/action-release@v1
if: github.event.deployment_status.environment == 'production'
env:
@ -23,9 +26,6 @@ jobs:
SENTRY_PROJECT: jarvis
with:
environment: ${{ github.event.deployment_status.environment }}
- uses: actions/setup-node@v2
with:
node-version: 12.x
- uses: browser-actions/setup-chrome@latest
with:
chrome-version: stable

13
Dockerfile

@ -1,13 +0,0 @@
# pulls from pre-built Hugo base image:
# https://github.com/jakejarvis/hugo-docker/blob/master/Dockerfile
FROM ghcr.io/jakejarvis/hugo-extended:0.84.1
ADD package.json .
ADD yarn.lock .
RUN yarn install
# expose live-refresh server (on custom port)
EXPOSE 1337
ENTRYPOINT ["yarn"]
CMD ["start"]

12
README.md

@ -17,18 +17,6 @@ I keep an ongoing list of [blog post ideas](https://github.com/jakejarvis/jarv.i
Run `yarn install` ([Yarn must be installed](https://yarnpkg.com/en/docs/install) first; NPM _should_ work at your own risk) and `yarn start`, then open [http://localhost:1337/](http://localhost:1337/). Pages will live-refresh when source files are changed.
### 🐳  Using Docker:
To ensure consistency and compatibility, the [`Dockerfile`](Dockerfile) in this repository will download the correct version of the Hugo Extended binary and its dependencies, and start a live testing server in a temporary container.
Using Docker doesn't require Node or Yarn, but you can also use `yarn docker` which is simply an alias for:
```bash
docker run --rm -v $(pwd):/src -p 1337:1337 $(docker build --no-cache -q .)
```
Once built, these two methods act identically — simply open [http://localhost:1337/](http://localhost:1337/) as above.
### 🤯  Why does this sound _way_ more complex than it needs to be?!
[Because it is.](https://www.jvt.me/talks/overengineering-your-personal-website/)

3
package.json

@ -24,7 +24,6 @@
"lint:scss": "stylelint 'assets/sass/**/*.scss' --syntax scss",
"lint:md": "markdownlint 'content/**/*.md'",
"lint:prettier": "prettier --check .",
"docker": "docker run --rm -v $(pwd):/src:ro -p 1337:1337 $(docker build -q .)",
"percy": "npx percy snapshot"
},
"dependencies": {
@ -34,7 +33,7 @@
"@sentry/node": "^6.7.2",
"@sentry/tracing": "^6.7.2",
"dotenv": "^10.0.0",
"faunadb": "fauna/faunadb-js#master",
"faunadb": "^4.3.0",
"graphql": "^15.5.1",
"graphql-request": "^3.4.0",
"graphql-tag": "^2.12.5",

10
webpack.config.js

@ -13,7 +13,7 @@ module.exports = {
path.resolve(__dirname, "assets/sass/main.scss"),
],
mode: isProd ? "production" : "development",
devtool: "source-map",
devtool: isProd ? "nosources-source-map" : "source-map",
output: {
filename: isProd ? "js/[name]-[contenthash:8].js" : "js/[name].js",
path: path.resolve(__dirname, "static/assets/"),
@ -60,11 +60,12 @@ module.exports = {
{
test: /\.(sa|sc|c)ss$/i,
use: [
{ loader: MiniCssExtractPlugin.loader },
{ loader: "css-loader" },
MiniCssExtractPlugin.loader,
{ loader: "css-loader", options: { sourceMap: true } },
{
loader: "postcss-loader",
options: {
sourceMap: true,
postcssOptions: {
config: false,
plugins: [
@ -84,7 +85,7 @@ module.exports = {
},
},
},
{ loader: "sass-loader" },
{ loader: "sass-loader", options: { sourceMap: true } },
],
},
{
@ -131,7 +132,6 @@ module.exports = {
devServer: {
contentBase: path.join(__dirname, "public/"),
publicPath: "/assets/",
// host: "0.0.0.0", // required when inside Docker
port: process.env.PORT || 1337,
compress: true,
},

11
yarn.lock

@ -1241,9 +1241,9 @@
form-data "^3.0.0"
"@types/node@*":
version "15.12.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.4.tgz#e1cf817d70a1e118e81922c4ff6683ce9d422e26"
integrity sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA==
version "15.12.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.5.tgz#9a78318a45d75c9523d2396131bd3cca54b2d185"
integrity sha512-se3yX7UHv5Bscf8f1ERKvQOD6sTyycH3hdaoozvaLxgUiY5lIGEeH37AD0G0Qi9kPqihPn0HOfd2yaIEN9VwEg==
"@types/normalize-package-data@^2.4.0":
version "2.4.0"
@ -4465,9 +4465,10 @@ fastq@^1.6.0:
dependencies:
reusify "^1.0.4"
faunadb@fauna/faunadb-js#master:
faunadb@^4.3.0:
version "4.3.0"
resolved "https://codeload.github.com/fauna/faunadb-js/tar.gz/5ef5d1a10e7e707ec943edf946d7c1af4272525b"
resolved "https://registry.yarnpkg.com/faunadb/-/faunadb-4.3.0.tgz#7c272b108c4be46eb8e58f9dfa37366adc9e9602"
integrity sha512-H5ZnInUNLAvrjqDHYXmYX+S55HP8Ib85QbF/UK1fV/bz125unl7J7LbjqKvMGcREYqOvIrpQCaniK1LwAkXHTw==
dependencies:
abort-controller "^3.0.0"
base64-js "^1.2.0"

Loading…
Cancel
Save