Merge pull request #308 from nutanix/dsl-381-cut #53
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: Setup & Build release containers | |
on: | |
push: | |
branches: | |
- 'release/**' | |
pull_request: | |
branches: | |
- 'release/**' | |
jobs: | |
build: | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ['3.7'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup env | |
run: | | |
python -m pip install --upgrade pip | |
pip install virtualenv | |
- name: Build docker image | |
run: | | |
make docker | |
- name: Read VERSION file | |
id: getversion | |
run: echo "::set-output name=version::$(cat CalmVersion)" | |
- name: Execute container | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: ntnx/calm-dsl | |
run: calm | |
- name: Publish docker image to jfrog-artifactory | |
if: ${{ github.repository == 'nutanix/calm-dsl' && matrix.python-version == '3.7'}} | |
run: | | |
docker login ${{ secrets.JFROG_REGISTRY }} -u ${{ secrets.JFROG_USERNAME }} -p ${{ secrets.JFROG_PASSWORD }} | |
docker tag ntnx/calm-dsl:latest ${{ secrets.JFROG_REGISTRY }}/calm-dsl/calm-dsl:v${{ steps.getversion.outputs.version }} | |
docker push ${{ secrets.JFROG_REGISTRY }}/calm-dsl/calm-dsl:v${{ steps.getversion.outputs.version }} |