Skip to content

Commit

Permalink
Add Docker caching to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Nov 24, 2021
1 parent 462f36f commit 05daaaf
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,27 @@ jobs:
ruby-version: 3.0.1
bundler-cache: true
- uses: docker/setup-buildx-action@v1
with:
install: true
- uses: docker/login-action@v1
with:
registry: registry.digitalocean.com
username: ${{ secrets.do_token }}
password: ${{ secrets.do_token }}
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: buildx-cache-${{ github.sha }}
restore-keys: |
buildx-cache
- name: Build Docker image
run: |
bundle exec kuby -e production build
bundle exec kuby -e production build -- --cache-from=type=local,src=/tmp/.buildx-cache --cache-to=type=local,dest=/tmp/.buildx-cache-new --load
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Push Docker image
run: |
bundle exec kuby -e production push
Expand Down
40 changes: 23 additions & 17 deletions gemfiles/deploy.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
GIT
remote: https://github.com/anycable/kuby-core.git
revision: 34a2d0caf1b1ddcbbc89b673ac6d2cf1afb2824a
branch: feat/docker-build-custom
specs:
kuby-core (0.13.0)
colorize (~> 0.8)
docker-remote (~> 0.6)
gli (~> 2.0)
helm-cli (~> 0.3)
krane (>= 1.1.4, < 2.0)
kube-dsl (~> 0.4)
kubernetes-cli (~> 0.3)
kuby-cert-manager (>= 0.3)
kuby-kube-db (>= 0.6)
railties (>= 5.1)
rouge (~> 3.0)
sorbet-runtime-stub (~> 0.2)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -126,19 +145,6 @@ GEM
kuby-cert-manager (0.3.0)
helm-cli (~> 0.1)
kube-dsl (~> 0.1)
kuby-core (0.13.0)
colorize (~> 0.8)
docker-remote (~> 0.6)
gli (~> 2.0)
helm-cli (~> 0.3)
krane (>= 1.1.4, < 2.0)
kube-dsl (~> 0.4)
kubernetes-cli (~> 0.3)
kuby-cert-manager (>= 0.3)
kuby-kube-db (>= 0.6)
railties (>= 5.1)
rouge (~> 3.0)
sorbet-runtime-stub (~> 0.2)
kuby-digitalocean (0.4.3)
droplet_kit (~> 3.5)
kube-dsl (~> 0.1)
Expand All @@ -151,9 +157,9 @@ GEM
nokogiri (>= 1.5.9)
memoist (0.16.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0901)
mime-types-data (3.2021.1115)
minitest (5.14.4)
multi_json (1.15.0)
multipart-post (2.1.1)
Expand All @@ -163,7 +169,7 @@ GEM
nokogiri (1.12.5-x86_64-linux)
racc (~> 1.4)
oj (3.13.9)
os (1.1.1)
os (1.1.4)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -225,7 +231,7 @@ PLATFORMS

DEPENDENCIES
activesupport (~> 6.1)
kuby-core (~> 0.13.0)
kuby-core (~> 0.13.0)!
kuby-digitalocean (~> 0.4.3)
pry-byebug

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/kuby.gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gem 'activesupport', '~> 6.1'
gem 'kuby-core', '~> 0.13.0'
gem 'kuby-core', '~> 0.13.0', github: 'anycable/kuby-core', branch: 'feat/docker-build-custom'
gem 'kuby-digitalocean', '~> 0.4.3'

0 comments on commit 05daaaf

Please sign in to comment.