Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #436 from HewlettPackard/dockerimage_version
Changes for docker image while release versioning
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Check out code | ||
- name: Set up Ruby 2.6 | ||
uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6.x | ||
- name: Set Credentials | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n:rubygems_api_key: Bearer ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}} | ||
- name: Publish to RubyGems | ||
run: | | ||
gem build *.gemspec | ||
gem push --KEY rubygems_api_key *.gem | ||
- run: | | ||
echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10}) | ||
- name: Login to Docker Hub | ||
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
- name: Build the tagged Docker image | ||
run: docker build . --file Dockerfile --tag hewlettpackardenterprise/hpe-oneview-sdk-for-ruby:${{ env.RELEASE_VERSION }}-OV5.4 | ||
- name: Push the tagged Docker image | ||
run: docker push hewlettpackardenterprise/hpe-oneview-sdk-for-ruby:${{ env.RELEASE_VERSION }}-OV5.4 |
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