Skip to content

Commit

Permalink
tech: update deps and add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kugaevsky committed Feb 26, 2022
1 parent ac5eb61 commit a538bb1
Show file tree
Hide file tree
Showing 14 changed files with 1,533 additions and 922 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ VCS_REF=$(git rev-parse --short HEAD)
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
VERSION=latest
REDIS_URL=redis://redis:6379
DATABASE_URL=postgres://postgres:postgres@postgres:5432

14 changes: 14 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Deploy container to production
on: workflow_dispatch
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
- name: Update and restart docker container
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
script: sudo /opt/it52/update_docker
33 changes: 33 additions & 0 deletions .github/workflows/docker-build-and-push-develpoment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Docker build and push develpoment
on:
push:
branches:
- 'it52'
jobs:
build-development:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: ./
file: ./docker/Dockerfile
build-args: RAILS_MASTER_KEY=${{ secrets.RAILS_MASTER_KEY }}
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: it52/rails:latest
cache-from: type=registry,ref=it52/rails:buildcache-dev
cache-to: type=registry,ref=it52/rails:buildcache-dev,mode=max
33 changes: 33 additions & 0 deletions .github/workflows/docker-build-and-push-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Docker build and push production
on:
push:
branches:
- 'it52'
jobs:
build-production:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: ./
file: ./docker/Dockerfile.production
build-args: RAILS_MASTER_KEY=${{ secrets.RAILS_MASTER_KEY }}
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: it52/rails:production
cache-from: type=registry,ref=it52/rails:buildcache-prod
cache-to: type=registry,ref=it52/rails:buildcache-prod,mode=max
File renamed without changes.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ gem 'autoprefixer-rails'
gem 'font-awesome-sass'
gem 'sassc-rails', '>= 2.1.2'
gem 'uglifier'
gem 'webpacker', '>= 4.2.2'
gem 'webpacker'

# View template compilers and helpers
gem 'jbuilder', '~> 2.9', '>= 2.9.1'
Expand Down Expand Up @@ -85,7 +85,6 @@ gem 'carrierwave-vips', '>= 1.2.0'
gem 'fog-aws', '< 3'

# Monitoring
gem 'barnes'
gem 'newrelic_rpm'
gem 'rollbar'
gem 'silencer'
Expand Down
Loading

0 comments on commit a538bb1

Please sign in to comment.