Skip to content

Commit

Permalink
Added docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasperson committed Oct 23, 2022
1 parent ee92fd2 commit fa48252
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Ruby Docker Build
'on':
workflow_dispatch: {}
push: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: '0'
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_SAMPLES_USERNAME }}
password: ${{ secrets.DOCKERHUB_SAMPLES_PASSWORD }}
- name: Install Bundler
run: gem install bundler
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: 5.x
- id: determine_version
name: Determine Version
uses: gittools/actions/gitversion/[email protected]
with:
additionalArguments: /overrideconfig mode=Mainline
- name: Install Octopus Deploy CLI
uses: OctopusDeploy/install-octopus-cli-action@v1
with:
version: latest
- name: Install Dependencies
run: bundle install
shell: bash
- name: Test
run: gem install rspec_junit_formatter; rspec --format RspecJunitFormatter --out results.xml
shell: bash
- if: always()
name: Report
uses: dorny/test-reporter@v1
with:
name: Ruby Tests
path: results.xml
reporter: java-junit
fail-on-error: 'false'
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: octopussamples/randomquotesruby:latest
- name: Create Octopus Release
uses: OctopusDeploy/[email protected]
with:
api_key: ${{ secrets.OCTOPUS_API_TOKEN }}
project: Random Quotes
server: ${{ secrets.OCTOPUS_SERVER_URL }}
deploy_to: Dev
packages: randomquotes:${{ steps.determine_version.outputs.semVer }}

0 comments on commit fa48252

Please sign in to comment.