From 7354994fd77631038d11dd0d63b4b818c108154b Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 4 Mar 2024 09:05:20 +0000 Subject: [PATCH 1/8] do a docker build for PRs Now that it's faster with depot, we can do this to make sure everything builds OK before merge. --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d4d1d6416..6eaccfd9b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,6 +1,7 @@ name: Docker on: + pull_request: push: tags: - v* From f2510311f46aaac73f735b56de68335b80be613c Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 4 Mar 2024 09:12:48 +0000 Subject: [PATCH 2/8] include dev dependencies in docker build so we can use esbuild --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0b41a28ad..9c643bb0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN yarn install --prod RUN gem install bundler -v 2.4.13 RUN bundle config set --local deployment 'true' -RUN bundle config set --local without 'development test' +RUN bundle config set --local without 'test' COPY Gemfile* ./ RUN bundle install From ff9d6c01a5386e24e6a07e38d13a483d7a4f7dd2 Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 4 Mar 2024 09:14:52 +0000 Subject: [PATCH 3/8] add docker PR tag --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6eaccfd9b..f0c37f7b7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -35,6 +35,7 @@ jobs: type=raw,value=${{ inputs.tag }},event=workflow_dispatch type=schedule,pattern=nightly type=semver,pattern={{version}} + type=ref,event=pr - name: Depot setup uses: depot/setup-action@v1 From 789ac84f3559f9c177151a8fee46a8f29ab3d668 Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 4 Mar 2024 09:21:26 +0000 Subject: [PATCH 4/8] install yarn dependencies for esbuild, not bundler duh --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9c643bb0b..fadc9c093 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,11 +19,11 @@ WORKDIR /usr/src/app COPY package.json . COPY yarn.lock . RUN yarn config set network-timeout 600000 -g -RUN yarn install --prod +RUN yarn install RUN gem install bundler -v 2.4.13 RUN bundle config set --local deployment 'true' -RUN bundle config set --local without 'test' +RUN bundle config set --local without 'development test' COPY Gemfile* ./ RUN bundle install From b3c58c611adc0af2a374c17cd586479d76992221 Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 4 Mar 2024 09:33:34 +0000 Subject: [PATCH 5/8] don't push PR tags to container registry --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f0c37f7b7..b5ba1f9f2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -55,7 +55,7 @@ jobs: context: . file: ./Dockerfile platforms: linux/amd64,linux/arm/v7,linux/arm64 - push: true + push: github.event_name != "pull_request" tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} build-args: | From 4a012b8f772312a88801243d54b628575b3227b6 Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 4 Mar 2024 09:47:44 +0000 Subject: [PATCH 6/8] fix expression in docker action --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b5ba1f9f2..542824fea 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -55,7 +55,7 @@ jobs: context: . file: ./Dockerfile platforms: linux/amd64,linux/arm/v7,linux/arm64 - push: github.event_name != "pull_request" + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} build-args: | From 656af497b5cc3aedaa8edee5549441d49f730734 Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 4 Mar 2024 09:52:06 +0000 Subject: [PATCH 7/8] reduce duplication in builds --- .github/workflows/docker.yml | 2 ++ .github/workflows/push.yml | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 542824fea..fe691abcf 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,9 @@ name: Docker on: pull_request: + branches: [ "main" ] push: + branches: [ "main" ] tags: - v* workflow_dispatch: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a8c6aeb77..23ae3c7b6 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,8 +1,10 @@ name: Ruby on: - - push - - pull_request + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] jobs: test: From b7d96bf3dc766343fb58be2da93c1f67b185b184 Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 4 Mar 2024 11:06:00 +0000 Subject: [PATCH 8/8] need sass at compile time in docker as well --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 806952491..56d592c08 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,9 @@ "i18n-js": "^4.4.3", "jquery": "^3.7.1", "masonry-layout": "^4.2.2", - "three": "^0.162.0" + "three": "^0.162.0", + "esbuild": "^0.20.1", + "sass": "^1.71.1" }, "version": "0.1.0", "devDependencies": { @@ -31,10 +33,8 @@ "@types/three": "^0.162.0", "@types/webpack-env": "^1.18.4", "@typescript-eslint/parser": "^7.1.0", - "esbuild": "^0.20.1", "eslint": "^8.57.0", "husky": "^9.0.11", - "sass": "^1.71.1", "ts-standard": "^12.0.2", "typescript": "^5.3.3" }