Skip to content

Commit

Permalink
Testing Github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
alisha-k-kalladassery committed Sep 19, 2022
1 parent 78c3810 commit 419d41f
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ jobs:
version=$(echo ${GITHUB_REF:10} | cut -c 2-)
echo "GITHUB_VERSION=${version}" >> $GITHUB_ENV
- name: Login to Docker Hub
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
# - 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-ansible-collection:${{ env.GITHUB_REF }}-OV7.2
# - name: Build the tagged Docker image
# run: docker build . --file Dockerfile --tag hewlettpackardenterprise/hpe-oneview-sdk-for-ansible-collection:${{ env.GITHUB_REF }}-OV7.2

- name: Push the tagged Docker image
run: docker push hewlettpackardenterprise/hpe-oneview-sdk-for-ansible-collection:${{ env.GITHUB_REF }}-OV7.2
# - name: Push the tagged Docker image
# run: docker push hewlettpackardenterprise/hpe-oneview-sdk-for-ansible-collection:${{ env.GITHUB_REF }}-OV7.2

- name: Build and publish
run: |
ansible-galaxy collection build .
ansible-galaxy collection publish hpe-oneview-${{ env.GITHUB_VERSION }}.tar.gz --api-key="${{ secrets.GALAXY_API_TOKEN }}"
# - name: Build and publish
# run: |
# ansible-galaxy collection build .
# ansible-galaxy collection publish hpe-oneview-${{ env.GITHUB_VERSION }}.tar.gz --api-key="${{ secrets.GALAXY_API_TOKEN }}"
29 changes: 29 additions & 0 deletions .github/workflows/createtagandrelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: create tag and relese

on:
pull_request:
types: [closed]
jobs:
create-tag:
runs-on: ubuntu-latest
permissions:
contents: write
if: github.event.pull_request.merged && startsWith(github.head_ref, 'PR') && startsWith(github.base_ref, 'master')
steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_and_prepare_release
uses: moble/github-tag-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
CUSTOM_TAG: "v7.2.1"
- name: Display
run: echo ${{ steps.tag_and_prepare_release.outputs.new_tag }}
- uses: actions/checkout@v2
- uses: ncipollo/release-action@v1
with:
name: ${{ steps.tag_and_prepare_release.outputs.new_tag }}
tag: ${{ steps.tag_and_prepare_release.outputs.new_tag }}
body: See the <a href="https://github.com/HewlettPackard/oneview-python/blob/master/CHANGELOG.md">CHANGELOG.md</a> for details.
token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/pullrequestforrelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Raise a Pullrequest

on:
push:
branches:
- "PR" # Support wildcard matching

jobs:
pull-request:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v2
- name: pull-request
uses: repo-sync/pull-request@v2
with:
source_branch: "PR" # If blank, default: triggered branch
destination_branch: "master" # If blank, default: master
pr_label: "automation"
pr_title: "Testing Ansible Automation" # Title of pull request
pr_reviewer: "alisha-k-kalladassery"
pr_body: ":crown: *An automated PR*" # Full markdown support, requires pr_title to be set
pr_template: ".github/PULL_REQUEST_TEMPLATE.md" # Path to pull request template, requires pr_title to be set, excludes pr_body
pr_allow_empty: true
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 419d41f

Please sign in to comment.