From 90feff2bfcbdb5586a459c2350a4172a4423668e Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 13 Mar 2024 22:06:46 +0100 Subject: ci: deploy the built Docker image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ Dockerfile | 2 +- Gemfile | 1 - Gemfile.lock | 6 ------ README.md | 22 ++++++++++++++-------- 5 files changed, 47 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54baa0e..e024ff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,3 +54,35 @@ jobs: run: | bin/rails test bin/rails test:system + + deploy: + runs-on: ubuntu-latest + needs: [lint, test] + if: github.event_name == 'push' + steps: + - uses: actions/checkout@v2 + + - name: Build production Docker image + run: | + docker build --tag ${{ secrets.REGISTRY_HOST }}/${{ secrets.REGISTRY_USERNAME }}/operum:main . + + - name: Push Docker image + run: | + # The login is done with the default docker password storage, which is + # not the safest around, but it will be removed by a subsequent logout + # later on. + docker login -u "${{ secrets.REGISTRY_USERNAME }}" -p "${{ secrets.REGISTRY_PASSWORD }}" ${{ secrets.REGISTRY_HOST }} + docker push ${{ secrets.REGISTRY_HOST }}/${{ secrets.REGISTRY_USERNAME }}/operum:main + docker logout ${{ secrets.REGISTRY_HOST }} + + # The server provides a small script named `service-restart` which will do + # the right thing to pull the new image of the desired service and re-run + # it. + - name: Restart service with the new code + uses: garygrossgarten/github-action-ssh@release + with: + command: infra-restart operum + host: ${{ secrets.REMOTE_HOST }} + username: ${{ secrets.REMOTE_USERNAME }} + passphrase: ${{ secrets.REMOTE_PASSPHRASE }} + privateKey: ${{ secrets.PRIVATE_KEY}} diff --git a/Dockerfile b/Dockerfile index 5cb8402..ae6eeae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,4 +59,4 @@ ENTRYPOINT ["/rails/bin/docker-entrypoint"] # Start the server by default, this can be overwritten at runtime EXPOSE 3000 -CMD ["thrust", "./bin/rails", "server"] +CMD ["./bin/rails", "server"] diff --git a/Gemfile b/Gemfile index d125a8d..e81d84d 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,6 @@ gem 'sqlite3', '~> 1.4' # Web server. gem 'puma', '>= 5.0' -gem 'thruster' # Use JavaScript with ESM import maps. gem 'importmap-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 803d4e7..088670d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -271,11 +271,6 @@ GEM railties (>= 6.0.0) stringio (3.1.0) thor (1.3.0) - thruster (0.1.0) - thruster (0.1.0-aarch64-linux) - thruster (0.1.0-arm64-darwin) - thruster (0.1.0-x86_64-darwin) - thruster (0.1.0-x86_64-linux) timeout (0.4.1) turbo-rails (2.0.4) actionpack (>= 6.0.0) @@ -326,7 +321,6 @@ DEPENDENCIES sprockets-rails sqlite3 (~> 1.4) stimulus-rails - thruster turbo-rails web-console diff --git a/README.md b/README.md index ef40c7c..412ba86 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,20 @@ > > — P. Ovidi Nasonis - Fasti 3.833-834 -This is a small application in order to keep track of books, articles, papers, -etc.; that you might have and need to know where they are, reference it on a -paper, etc. To sum things up, it's a way to keep your bibliography under -control. - -## Basic usage - -To do. +This is a simple application that keeps track of all your sources (i.e. books, +papers, articles). With this information at hand you can: + +- Add comments and notes to any source to keep track of what you found more + relevant from it. +- Tag sources and comments in the way you wish. +- Save searches that match on a user-defined tag, or a certain string from any + of your comments. +- Export searches into CSV or TeX so it can be used for building up bibliography + sections on a paper you might be working on. + +The *workflow* revolves around the idea of being able to tag sources and +comments with tags that you might want to define, and then being able to list +sources with searches based on these tags. ## Deployment -- cgit v1.2.3