Merge pull request #662 from voxpupuli/ci2 #353
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
# 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@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
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/'" |