Skip to content

Upload release to Galaxy #37

Upload release to Galaxy

Upload release to Galaxy #37

Workflow file for this run

name: Upload release to Galaxy
on:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible
- name: Setup environment for collection publish
run: |
echo "GITHUB_REF=${GITHUB_REF:10}" >> $GITHUB_ENV
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: Build the tagged Docker image
run: docker build . --file Dockerfile --tag hewlettpackardenterprise/hpe-oneview-sdk-for-ansible-collection:${{ env.GITHUB_REF }}-OV8.6
- name: Push the tagged Docker image
run: docker push hewlettpackardenterprise/hpe-oneview-sdk-for-ansible-collection:${{ env.GITHUB_REF }}-OV8.6
- 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 }}"