Skip to content

Commit

Permalink
Migrate from Heroku to Scaleway
Browse files Browse the repository at this point in the history
  • Loading branch information
ssaunier committed May 7, 2024
1 parent 7dd8d7c commit 6ae016c
Show file tree
Hide file tree
Showing 33 changed files with 223 additions and 244 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy
on:
workflow_dispatch:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Cloning repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Push to Scaleway (Dokku)
uses: dokku/github-action@master
with:
command: deploy
git_remote_url: "ssh://[email protected]/garage-api"
git_push_flags: "--force -vvv"

# NOTE(ssaunier): having `id_ed25519` `id_ed25519.pub` localy:
# cat ~/code/lewagon/glovebox/id_ed25519.pub | ssh [email protected] dokku ssh-keys:add "ssaunier_github@dokku"
# ssh students ssh-keys:list
# cat ~/code/lewagon/glovebox/id_ed25519 | pbcopy # To be added to https://github.com/lewagon/garage-api/settings/secrets/actions
ssh_private_key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }}

# cat ~/.ssh/known_hosts | grep "students.lewagon.engineering ssh-rsa"
ssh_host_key: |
students.lewagon.engineering ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCp7UWRGPtC4QermDmb4BZq2zdin7YQMqvwv//nLiu955amaBWvxP4MFXTr4Ig20PFSRVe8nwcnLgiHLhi1Jakr08jHGrcF3TykIGdFTNpqP5trmBNA711BOQVtrC0h4EQvuavjO8pVe0IhU0cCVHsRtIWKiHT+RwTdwuMrFxeA8ecu9DnWvG4KHkPL8fXVvUg59AN3CUKd6cGd5Vwfhxh1CTgxnZGmEpFlnRyqCX2yHojtsJCItGjDgvkme468GiaCMCQQuURrl5Q+EX2uo6csDKjYPu7Wnznp0pGuCfDkFRMe1xaSgqkspulRimwp2I7Vr0xHylhUgmQ+c2RlLovQcOJLOsqobkHChqBfUxS4S6/h3yttoORFIp+fsvpsmfuzIRojz/MxzVTE1evfR4NtpflNuAQeTk28+oB4SpqyIXgwX9eFMpcyCbd3UlNd0mO3yKqiUBs3M0pZPKcwTaZi9xOCDoGXGO1cNu+JWipTXydMespblDIFUJVJ+jEbt+8=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
/yarn-error.log

.byebug_history
.DS_Store
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0
3.3.1
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
source "https://rubygems.org"

ruby "3.2.0"
ruby "3.3.1"

gem "rails", "~> 7"
gem "rails", "~> 7.1"
gem "pg"
gem "puma"
gem "jbuilder", "~> 2.5"
Expand Down
237 changes: 135 additions & 102 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,164 +1,197 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.4.2)
actionpack (= 7.0.4.2)
activesupport (= 7.0.4.2)
actioncable (7.1.3.2)
actionpack (= 7.1.3.2)
activesupport (= 7.1.3.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.4.2)
actionpack (= 7.0.4.2)
activejob (= 7.0.4.2)
activerecord (= 7.0.4.2)
activestorage (= 7.0.4.2)
activesupport (= 7.0.4.2)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.2)
actionpack (= 7.1.3.2)
activejob (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.4.2)
actionpack (= 7.0.4.2)
actionview (= 7.0.4.2)
activejob (= 7.0.4.2)
activesupport (= 7.0.4.2)
actionmailer (7.1.3.2)
actionpack (= 7.1.3.2)
actionview (= 7.1.3.2)
activejob (= 7.1.3.2)
activesupport (= 7.1.3.2)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.4.2)
actionview (= 7.0.4.2)
activesupport (= 7.0.4.2)
rack (~> 2.0, >= 2.2.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.3.2)
actionview (= 7.1.3.2)
activesupport (= 7.1.3.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.4.2)
actionpack (= 7.0.4.2)
activerecord (= 7.0.4.2)
activestorage (= 7.0.4.2)
activesupport (= 7.0.4.2)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.2)
actionpack (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.4.2)
activesupport (= 7.0.4.2)
actionview (7.1.3.2)
activesupport (= 7.1.3.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.4.2)
activesupport (= 7.0.4.2)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.3.2)
activesupport (= 7.1.3.2)
globalid (>= 0.3.6)
activemodel (7.0.4.2)
activesupport (= 7.0.4.2)
activemodel (7.1.3.2)
activesupport (= 7.1.3.2)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (7.0.4.2)
activemodel (= 7.0.4.2)
activesupport (= 7.0.4.2)
activestorage (7.0.4.2)
actionpack (= 7.0.4.2)
activejob (= 7.0.4.2)
activerecord (= 7.0.4.2)
activesupport (= 7.0.4.2)
activerecord (7.1.3.2)
activemodel (= 7.1.3.2)
activesupport (= 7.1.3.2)
timeout (>= 0.4.0)
activestorage (7.1.3.2)
actionpack (= 7.1.3.2)
activejob (= 7.1.3.2)
activerecord (= 7.1.3.2)
activesupport (= 7.1.3.2)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.4.2)
activesupport (7.1.3.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
base64 (0.2.0)
bigdecimal (3.1.8)
builder (3.2.4)
concurrent-ruby (1.2.0)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crass (1.0.6)
date (3.3.3)
date (3.3.4)
drb (2.2.1)
erubi (1.12.0)
ffi (1.15.5)
globalid (1.1.0)
activesupport (>= 5.0)
i18n (1.12.0)
ffi (1.16.3)
globalid (1.2.1)
activesupport (>= 6.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
jbuilder (2.11.5)
io-console (0.7.2)
irb (1.13.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jbuilder (2.12.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
listen (3.8.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.19.1)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
nokogiri (>= 1.12.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.17.0)
net-imap (0.3.4)
marcel (1.0.4)
mini_mime (1.1.5)
mini_portile2 (2.8.6)
minitest (5.22.3)
mutex_m (0.2.0)
net-imap (0.4.10)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
net-protocol (0.2.2)
timeout
net-smtp (0.3.3)
net-smtp (0.5.0)
net-protocol
nio4r (2.5.8)
nokogiri (1.14.2)
mini_portile2 (~> 2.8.0)
nio4r (2.7.2)
nokogiri (1.16.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
pg (1.4.5)
puma (6.1.0)
pg (1.5.6)
psych (5.1.2)
stringio
puma (6.4.2)
nio4r (~> 2.0)
racc (1.6.2)
rack (2.2.6.2)
rack-cors (2.0.0)
racc (1.7.3)
rack (3.0.10)
rack-cors (2.0.2)
rack (>= 2.0.0)
rack-test (2.0.2)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.4.2)
actioncable (= 7.0.4.2)
actionmailbox (= 7.0.4.2)
actionmailer (= 7.0.4.2)
actionpack (= 7.0.4.2)
actiontext (= 7.0.4.2)
actionview (= 7.0.4.2)
activejob (= 7.0.4.2)
activemodel (= 7.0.4.2)
activerecord (= 7.0.4.2)
activestorage (= 7.0.4.2)
activesupport (= 7.0.4.2)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.1.3.2)
actioncable (= 7.1.3.2)
actionmailbox (= 7.1.3.2)
actionmailer (= 7.1.3.2)
actionpack (= 7.1.3.2)
actiontext (= 7.1.3.2)
actionview (= 7.1.3.2)
activejob (= 7.1.3.2)
activemodel (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
bundler (>= 1.15.0)
railties (= 7.0.4.2)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
railties (= 7.1.3.2)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
railties (7.0.4.2)
actionpack (= 7.0.4.2)
activesupport (= 7.0.4.2)
method_source
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.3.2)
actionpack (= 7.1.3.2)
activesupport (= 7.1.3.2)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.0.6)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
thor (1.2.1)
timeout (0.3.1)
rdoc (6.6.3.1)
psych (>= 4.0.0)
reline (0.5.5)
io-console (~> 0.5)
stringio (3.1.0)
thor (1.3.1)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
websocket-driver (0.7.5)
webrick (1.8.1)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.7)
zeitwerk (2.6.13)

PLATFORMS
ruby
Expand All @@ -170,10 +203,10 @@ DEPENDENCIES
pg
puma
rack-cors
rails (~> 7)
rails (~> 7.1)

RUBY VERSION
ruby 3.2.0p0
ruby 3.3.1p55

BUNDLED WITH
2.2.13
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Here's the HTTP request you can run. Be careful, `:garage` in the URL is **dynam

```bash
verb GET
url: https://wagon-garage-api.herokuapp.com/:garage/cars # Default: JSON format
url: https://wagon-garage-api.herokuapp.com/:garage/cars.xml # Variant: XML format
url: https://garage.api.lewagon.com/:garage/cars # Default: JSON format
url: https://garage.api.lewagon.com/:garage/cars.xml # Variant: XML format
```

You may choose any name for **your** garage. Your buddy and you should have different garage names! Example of garage names: 'reparator-2000', 'bricolman', 'abitbol-and-son', etc.
Expand All @@ -20,7 +20,7 @@ To add a new car to your garage, you need to send this HTTP request:

```bash
verb: POST
url: https://wagon-garage-api.herokuapp.com/:garage/cars
url: https://garage.api.lewagon.com/:garage/cars
headers: Content-Type: application/json
body:
{
Expand All @@ -37,7 +37,7 @@ If you know the `:id` of a car, you can retrieve its information with:

```bash
verb GET
url: https://wagon-garage-api.herokuapp.com/cars/:id
url: https://garage.api.lewagon.com/cars/:id
```

## Destroy a car
Expand All @@ -46,5 +46,5 @@ If you know the `:id` of a car, you can remove it with:

```bash
verb: DELETE
url: https://wagon-garage-api.herokuapp.com/cars/:id
url: https://garage.api.lewagon.com/cars/:id
```
Loading

0 comments on commit 6ae016c

Please sign in to comment.