Skip to content

Merge pull request #659 from voxpupuli/dependabot/github_actions/dock… #350

Merge pull request #659 from voxpupuli/dependabot/github_actions/dock…

Merge pull request #659 from voxpupuli/dependabot/github_actions/dock… #350

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: test-build-release
on:
push:
branches: master
tags:
- '*'
jobs:
test:
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development:release
steps:
- uses: actions/checkout@v4
- name: create git version file
run: git describe --always > VERSION
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Run tests
run: bundle exec rake rubocop
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
voxpupuli/vox-pupuli-tasks:latest
ghcr.io/voxpupuli/vox-pupuli-tasks:latest
- name: List images
run: docker image ls
- name: Run Docker Image
run: docker run --rm --env DRY_RUN=true --env RAILS_ENV=development --env NODE_ENV=development voxpupuli/vox-pupuli-tasks:latest ruby -e "puts 'we can use Ruby in the container \o/'"