Skip to content

Commit

Permalink
Add docker action and make version based on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaek committed Aug 18, 2020
1 parent 559517e commit b7a7496
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: sjaek/logstash-output-snmptrap
tags: ${LOGSTASH_VERSION}-${steps.get_version.outputs.VERSION}
tags: ${LOGSTASH_VERSION}-${{steps.get_version.outputs.VERSION}}
push: ${{ startsWith(github.ref, 'refs/tags/') }}
build_args: LOGSTASH_VERSION=${LOGSTASH_VERSION},PLUGIN_VERSION=${steps.get_version.outputs.VERSION}
labels: LOGSTASH_VERSION=${LOGSTASH_VERSION},PLUGIN_VERSION=${{steps.get_version.outputs.VERSION}}
build_args: LOGSTASH_VERSION=${LOGSTASH_VERSION},PLUGIN_VERSION=${{steps.get_version.outputs.VERSION}}
env:
LOGSTASH_VERSION: 7.8.1

5 changes: 5 additions & 0 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Get the tag name
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- uses: actions/checkout@v2
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
Expand All @@ -26,3 +30,4 @@ jobs:
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
GEM_VERSION: "${{steps.get_version.outputs.VERSION}}"
2 changes: 1 addition & 1 deletion logstash-output-snmptrap.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'logstash-output-snmptrap-v2'
s.version = '0.9.4'
s.version = ENV['GEM_VERSION'] || '0.0.1'
s.licenses = ['Apache-2.0']
s.summary = 'SNMP Output for Logstash'
s.description = 'This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program'
Expand Down

0 comments on commit b7a7496

Please sign in to comment.