Skip to content

Commit

Permalink
Create github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
L-Eugene committed Mar 20, 2024
1 parent db08fe9 commit 56f7a35
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish Docker Image

on:
release:
types:
- created

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2

- name: Install dependencies
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get versions
id: versions
run: |
echo "::set-output name=version::${GITHUB_REF/refs\/tags\/v/}"
echo "::set-output name=version_short::$(echo ${GITHUB_REF/refs\/tags\/v/} | cut -d. -f1,2)"
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ vars.DOCKERHUB_USERNAME }}/vkinformerbot:latest
${{ vars.DOCKERHUB_USERNAME }}/vkinformerbot:${{ steps.versions.outputs.version }}
${{ vars.DOCKERHUB_USERNAME }}/vkinformerbot:${{ steps.versions.outputs.version_short }}
30 changes: 30 additions & 0 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Ruby Application Validation

on:
push:
branches:
- '*'
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2

- name: Install dependencies
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Run validations
run: bundle exec rake

0 comments on commit 56f7a35

Please sign in to comment.