-
Notifications
You must be signed in to change notification settings - Fork 22
42 lines (33 loc) · 1.32 KB
/
.release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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 }}-OV9.1
- name: Push the tagged Docker image
run: docker push hewlettpackardenterprise/hpe-oneview-sdk-for-ansible-collection:${{ env.GITHUB_REF }}-OV9.1
- 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 }}"