Merge pull request #77 from AlexAvlonitis/dependabot/bundler/actionte… #88
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
container: ruby:3.3.5 | |
services: | |
mysql: | |
image: mysql:5.7.26 | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
elasticsearch: | |
image: elasticsearch:7.16.2 | |
options: >- | |
-e="discovery.type=single-node" | |
--health-cmd="curl http://elasticsearch:9200/_cluster/health" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=10 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build and test | |
env: | |
ELASTIC_SEARCH_HOST: http://elasticsearch:9200 | |
RAILS_ENV: test | |
FB_APP_ID: test | |
DBHOST: mysql | |
DBUSER: root | |
DBPASS: password | |
FB_APP_SECRET: secret | |
S3_BUCKET_NAME: s3_aws_bucket | |
AWS_ACCESS_KEY_ID: aws_id | |
AWS_SECRET_ACCESS_KEY: aws_secret | |
AWS_REGION: aws_region | |
run: | | |
gem install bundler | |
bundle install --jobs 4 --retry 3 | |
bundle exec rails db:setup | |
bundle exec rspec | |
docker-push: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: alexavlonitis/kardies:latest | |