From b01ac6c9355ab715d8c56c626b01a10301941568 Mon Sep 17 00:00:00 2001 From: Sumanth Lingappa <42572246+sumanth-lingappa@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:06:44 +0530 Subject: [PATCH] Create publish.yml workflow --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..f091cf7e0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +--- +name: Ansible collection publish +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: "Install tools" + run: "python -m pip install ansible-base --disable-pip-version-check" + + - name: "Build the collection" + run: ansible-galaxy collection build + + - name: "Upload built collection to release" + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: netscaler-adc-*.tar.gz + file_glob: true + tag: ${{ github.ref }} + overwrite: true + + - name: "Publish collection on galaxy" + uses: ansible/ansible-publish-action@v1.0.0 + with: + api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}