Version 1.9.6 #23
Workflow file for this run
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
name: Create docker release and github release | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [master] | |
types: [closed] | |
paths: ["nca/VERSION.txt"] | |
permissions: | |
contents: read | |
jobs: | |
push_to_registry: | |
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | |
name: Push a Docker image to the Docker Hub and create a github release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
- name: Setup NCA environment | |
uses: ./.github/actions/setup-nca-env | |
- name: Set the version number | |
run: | | |
export VERSION=$(cat nca/VERSION.txt) | |
echo "version=$VERSION" >> $GITHUB_ENV | |
- name: Log in to Docker Hub | |
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf | |
with: | |
context: . | |
push: true | |
tags: ghcr.io/ibm/nca:${{ env.version }} | |
- name: Build and push ubi-based Docker image | |
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf | |
with: | |
context: . | |
file: Dockerfile.ubi | |
push: true | |
tags: ghcr.io/ibm/nca:${{ env.version }}-ubi | |
- name: Create and push a new git tag | |
run: | | |
git config user.name ${{ github.actor }} | |
git tag -a v${{ env.version }} -m "Version ${{ env.version }}" | |
git push origin v${{ env.version }} | |
- name: Create a github release | |
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.version }} | |
release_name: Release v${{ env.version }} | |
body: | | |
Changes in this Release: | |
draft: false | |
prerelease: false | |
- name: Build package | |
run: | | |
pip install build==0.10.0 | |
python -m build | |
- name: Push version to PyPi | |
uses: pypa/gh-action-pypi-publish@0bf742be3ebe032c25dd15117957dc15d0cfc38d | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |