Skip to content

Commit

Permalink
add verification of the pushed image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeofblue committed Nov 2, 2023
1 parent 61550de commit a26a103
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
- uses: Gr1N/setup-poetry@v8
- name: Install requirements
run: poetry install --no-ansi
- name: Install gvmkit
run: pip install gvmkit-build
- name: Get Ray-On-Golem version
run: echo "::set-output name=version::$(poetry version | sed 's/ray-on-golem //')"
id: ray_on_golem_version
Expand All @@ -41,5 +39,15 @@ jobs:
run: gvmkit-build ray-on-golem:${{ steps.image_version.outputs.version }}
- name: Is test build?
run: echo "${{ inputs.is_test_build }}"
- name: Check YAML image tag
run: echo "::set-output name=tag::$(poetry run yaml-get -p provider.parameters.node_config.demand.image_tag golem-cluster-dev.yaml)
id: yaml_image_tag
- name: Set pushed image tag
run: echo "::set-output name=tag::${{ vars.REGISTRY_TEST_REPOSITORY }}:${{ steps.image_version.outputs.version }}"
id: pushed_image_tag
- name: Fail on YAML tag mismatch
run: exit 1
if:
${{ steps.yaml_image_tag.outputs.tag != steps.pushed_image_tag.outputs.tag }}
- name: Push the image
run: REGISTRY_USER=${{ secrets.REGISTRY_TEST_USER }} REGISTRY_TOKEN=${{ secrets.REGISTRY_TEST_TOKEN }} gvmkit-build ray-on-golem:${{ steps.image_version.outputs.version }} --push-to ${{ vars.REGISTRY_TEST_REPOSITORY }}:${{ steps.image_version.outputs.version }}
run: REGISTRY_USER=${{ secrets.REGISTRY_TEST_USER }} REGISTRY_TOKEN=${{ secrets.REGISTRY_TEST_TOKEN }} poetry run gvmkit-build ray-on-golem:${{ steps.image_version.outputs.version }} --push-to ${{ steps.pushed_image_tag.outputs.tag }}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ black = "^23.7.0"
isort = "^5.12.0"
autoflake = "^2.2.0"
gvmkit-build = "^0.3.13"
yamlpath = "^3.8.1"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit a26a103

Please sign in to comment.