Skip to content

Commit

Permalink
as
Browse files Browse the repository at this point in the history
  • Loading branch information
robguthrie committed Apr 18, 2023
1 parent cbf99c2 commit 07a5fd0
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker_image.yml
Expand Up @@ -5,10 +5,10 @@

name: Publish Docker image

on:
push:
release:
types: [published]
# on:
# push:
# release:
# types: [published]

jobs:
push_to_registry:
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/loomio_com_image.yml
Expand Up @@ -9,15 +9,13 @@ jobs:
name: Build and push loomio.com image
runs-on: ubuntu-latest
env:
HAVESECRET: ${{ secrets.DOCKER_USERNAME }}
GH_PAT: ${{ secrets.GH_PAT }}
steps:
- name: Check out loomio source
uses: actions/checkout@v3
if: env.HAVESECRET != null

- name: Check out loomio_subs engine
uses: actions/checkout@v3
if: env.HAVESECRET != null
with:
token: ${{ secrets.GH_PAT }}
repository: loomio/loomio_subs
Expand All @@ -26,7 +24,6 @@ jobs:

- name: Check out loomio-website gem
uses: actions/checkout@v3
if: env.HAVESECRET != null
with:
token: ${{ secrets.GH_PAT }}
repository: loomio/loomio-website
Expand All @@ -41,10 +38,9 @@ jobs:
cd ..
cp -R ./website/_site/* ./public/
rm -rf ./website
echo "hellooooo"
echo `ls -a`
- name: build docker image
run: |
echo $GH_PAT | docker login ghcr.io -u robguthrie --password-stdin
docker build . -t loomio/loomio_com:latest
docker push ghcr.io/loomio/loomio_com:latest
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
@@ -1,7 +1,7 @@
name: tests

on:
push:
# on:
# push: nothing

jobs:
rspec:
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -95,3 +95,5 @@ end
if Dir.exist?('engines/loomio_subs')
gem 'loomio_subs', path: 'engines/loomio_subs'
end

gem "mrsk", "~> 0.10.1"
19 changes: 18 additions & 1 deletion Gemfile.lock
Expand Up @@ -117,6 +117,7 @@ GEM
aws-sigv4 (1.5.2)
aws-eventstream (~> 1, >= 1.0.2)
bcrypt (3.1.18)
bcrypt_pbkdf (1.1.0)
blazer (2.6.5)
activerecord (>= 5)
chartkick (>= 3.2)
Expand Down Expand Up @@ -175,6 +176,7 @@ GEM
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
railties (>= 3.2)
ed25519 (1.3.0)
errbase (0.2.2)
erubi (1.12.0)
execjs (2.8.1)
Expand Down Expand Up @@ -361,6 +363,14 @@ GEM
mini_magick (4.12.0)
mini_mime (1.1.2)
minitest (5.18.0)
mrsk (0.10.1)
activesupport (>= 7.0)
bcrypt_pbkdf (~> 1.0)
dotenv (~> 2.8)
ed25519 (~> 1.2)
sshkit (~> 1.21)
thor (~> 1.2)
zeitwerk (~> 2.5)
msgpack (1.7.0)
multi_json (1.15.0)
multi_xml (0.6.0)
Expand All @@ -372,8 +382,11 @@ GEM
net-protocol
net-protocol (0.2.1)
timeout
net-scp (4.0.0)
net-ssh (>= 2.6.5, < 8.0.0)
net-smtp (0.3.3)
net-protocol
net-ssh (7.1.0)
net_http_timeout_errors (1.0.0)
nio4r (2.5.9)
nokogiri (1.14.3-x86_64-darwin)
Expand Down Expand Up @@ -556,6 +569,9 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.21.4)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
temple (0.10.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
Expand Down Expand Up @@ -634,6 +650,7 @@ DEPENDENCIES
listen
lograge
maxminddb
mrsk (~> 0.10.1)
nokogiri
oj
paper_trail (~> 14.0.0)
Expand Down Expand Up @@ -679,4 +696,4 @@ RUBY VERSION
ruby 3.2.2p53

BUNDLED WITH
2.4.10
2.4.12
27 changes: 27 additions & 0 deletions bin/mrsk
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'mrsk' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("mrsk", "mrsk")
78 changes: 78 additions & 0 deletions config/deploy.yml
@@ -0,0 +1,78 @@
# Name of your application. Used to uniquely configure containers.
service: loomio

# Name of the container image.
image: loomio/latest

# Deploy to these servers.
servers:
- 192.168.0.1

# Credentials for your image host.
registry:
# Specify the registry server, if you're not using Docker Hub
# server: registry.digitalocean.com / ghcr.io / ...
username: my-user

# Always use an access token rather than real password when possible.
password:
- MRSK_REGISTRY_PASSWORD

# Inject ENV variables into containers (secrets come from .env).
# env:
# clear:
# DB_HOST: 192.168.0.2
# secret:
# - RAILS_MASTER_KEY

# Call a broadcast command on deploys.
# audit_broadcast_cmd:
# bin/broadcast_to_bc

# Use a different ssh user than root
# ssh:
# user: app

# Configure builder setup.
# builder:
# args:
# RUBY_VERSION: 3.2.0
# secrets:
# - GITHUB_TOKEN
# remote:
# arch: amd64
# host: ssh://app@192.168.0.1

# Use accessory services (secrets come from .env).
# accessories:
# db:
# image: mysql:8.0
# host: 192.168.0.2
# port: 3306
# env:
# clear:
# MYSQL_ROOT_HOST: '%'
# secret:
# - MYSQL_ROOT_PASSWORD
# files:
# - config/mysql/production.cnf:/etc/mysql/my.cnf
# - db/production.sql.erb:/docker-entrypoint-initdb.d/setup.sql
# directories:
# - data:/var/lib/mysql
# redis:
# image: redis:7.0
# host: 192.168.0.2
# port: 6379
# directories:
# - data:/data

# Configure custom arguments for Traefik
# traefik:
# args:
# accesslog: true
# accesslog.format: json

# Configure a custom healthcheck (default is /up on port 3000)
# healthcheck:
# path: /healthz
# port: 4000

0 comments on commit 07a5fd0

Please sign in to comment.