Skip to content

Commit

Permalink
Fix deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonkrs committed Oct 5, 2024
1 parent 90762e5 commit 9435944
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ jobs:

env:
DOCKER_BUILDKIT: 1
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
COOLIFY_WEBHOOK: ${{ secrets.COOLIFY_WEBHOOK }}
COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }}
RAILS_ENV: production
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
KAMAL_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}

steps:
- uses: actions/checkout@v4
Expand All @@ -114,6 +114,10 @@ jobs:
with:
bundler-cache: true

- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -124,15 +128,23 @@ jobs:
username: andersonskm
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: andersonskm/malheatmap
labels: |
service=malheatmap
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64
tags: andersonskm/malheatmap:${{ github.sha }},andersonskm/malheatmap:latest
cache-from: type=gha
cache-to: type=gha,mode=max
labels: ${{ steps.meta.outputs.labels }}

- name: Run deploy command
run: ./bin/trigger-deployment
run: bin/kamal deploy -v --skip_push
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ GEM
safely_block (>= 0.4)
bootsnap (1.18.4)
msgpack (~> 1.2)
brakeman (6.1.2)
brakeman (6.2.1)
racc
builder (3.3.0)
capybara (3.40.0)
Expand Down
6 changes: 2 additions & 4 deletions test/jobs/concerns/unique_jobs_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ class Bucket < ApplicationRecord
class InvalidElement < StandardError; end

def fill_with(liquid)
raise InvalidElement if liquid.blank?

Rails.logger.debug(liquid)
end
end

class BucketJob < ApplicationJob
uniqueness_control key: ->(record, _) { [record.id, record.updated_at&.to_fs(:number)] },
uniqueness_control key: ->(record) { [record.id, record.updated_at&.to_fs(:number)] },
expires_in: 30.minutes

def perform(bucket, liquid = :water)
def perform(bucket)
bucket.fill_with(liquid)
end
end
Expand Down

0 comments on commit 9435944

Please sign in to comment.